Comments (3)
@tradzero Thanks for your replay, i am using following steps to resolve my issue.
Steps to resolve "CORS Missing Allow Origin" Error for your Echo Server on Windows 10 with XAMPP
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.
from laravel-echo-redis-socketio.
@sailendra2017 sorry for reply this so latey, this project is too old and not maintaining, but i try this in my mac, it runs well,
and i found when i run laravel-echo-server init
, it seems provide cors settings.
Here is my laravel-echo-server.json
file. you can refer to this.
{
"authHost": "http://localhost",
"authEndpoint": "/broadcasting/auth",
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": true,
"host": null,
"port": "6001",
"protocol": "http",
"socketio": {},
"secureOptions": 67108864,
"sslCertPath": "",
"sslKeyPath": "",
"sslCertChainPath": "",
"sslPassphrase": "",
"subscribers": {
"http": true,
"redis": true
},
"apiOriginAllow": {
"allowCors": true,
"allowOrigin": "http://localhost:80",
"allowMethods": "GET, POST",
"allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
}
}
from laravel-echo-redis-socketio.
@tradzero Thanks for your replay.I am using following steps to resolve my issue and its working for me
@sailendra2017 sorry for reply this so latey, this project is too old and not maintaining, but i try this in my mac, it runs well,
and i found when i runlaravel-echo-server init
, it seems provide cors settings.
Here is mylaravel-echo-server.json
file. you can refer to this.{ "authHost": "http://localhost", "authEndpoint": "/broadcasting/auth", "clients": [], "database": "redis", "databaseConfig": { "redis": {}, "sqlite": { "databasePath": "/database/laravel-echo-server.sqlite" } }, "devMode": true, "host": null, "port": "6001", "protocol": "http", "socketio": {}, "secureOptions": 67108864, "sslCertPath": "", "sslKeyPath": "", "sslCertChainPath": "", "sslPassphrase": "", "subscribers": { "http": true, "redis": true }, "apiOriginAllow": { "allowCors": true, "allowOrigin": "http://localhost:80", "allowMethods": "GET, POST", "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id" } }
from laravel-echo-redis-socketio.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-echo-redis-socketio.