Hi I am getting Following error after adding on my view page of laravel application.
I am using Windows 10 .
CORS Missing Allow Origin
Following Steps will resolve "CORS Missing Allow Origin" Error for your Echo Server
STEP-1: Add "transports: ['websocket', 'polling', 'flashsocket'] // Fix CORS error!" Code inside your Echo Server Setup File (public\js\laravel-echo-setup.js) like following code:
window.Echo = new Echo({
broadcaster: 'socket.io',
host: window.location.hostname + ':6001',
transports: ['websocket', 'polling', 'flashsocket'] // Fix CORS error!
});
STEP-2: Build Your Code Using "npm run dev" command Restart your Laravel Echo Server Using "laravel-echo-server start" command Now check your application, You can't find a CORS error now.