Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

help , Is this a bug? #557

Open
hgaoping opened this issue Jan 6, 2021 · 9 comments
Open

help , Is this a bug? #557

hgaoping opened this issue Jan 6, 2021 · 9 comments

Comments

@hgaoping
Copy link

hgaoping commented Jan 6, 2021

I have been using Laravel 5.8 and can use the laravel-echo function normally

Reinstalled today and found that the software package was updated, and the following problems occurred

微信截图_20210106202510

@hgaoping
Copy link
Author

hgaoping commented Jan 6, 2021

Access to XMLHttpRequest at 'http://www.v10.com:6001/socket.io/?EIO=3&transport=polling&t=NRNfdTe' from origin 'http://www.v10.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

@hgaoping
Copy link
Author

hgaoping commented Jan 6, 2021

this is my laravel-echo-server.json

{
"authHost": "http://www.v10.com",
"authEndpoint": "/broadcasting/auth",
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": false,
"host": null,
"port": "6001",
"protocol": "http",
"socketio": {},
"secureOptions": 67108864,
"sslCertPath": "",
"sslKeyPath": "",
"sslCertChainPath": "",
"sslPassphrase": "",
"subscribers": {
"http": true,
"redis": true
},
"apiOriginAllow": {
"allowCors": true,
"allowOrigin": "http://www.v10.com",
"allowMethods": "GET, POST",
"allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
}
}

@idanalkhalid
Copy link

i got same issue

@idanalkhalid
Copy link

this is my laravel-echo-server.json

{
"authHost": "http://www.v10.com",
"authEndpoint": "/broadcasting/auth",
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": false,
"host": null,
"port": "6001",
"protocol": "http",
"socketio": {},
"secureOptions": 67108864,
"sslCertPath": "",
"sslKeyPath": "",
"sslCertChainPath": "",
"sslPassphrase": "",
"subscribers": {
"http": true,
"redis": true
},
"apiOriginAllow": {
"allowCors": true,
"allowOrigin": "http://www.v10.com",
"allowMethods": "GET, POST",
"allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
}
}

hi i got solution, you need runing laravel-echo-server init..you can't edit from laravel-echo-server.json

referense
https://mrkaluzny.com/blog/using-laravel-echo-with-socket-io-and-vue-spa/

@ghost
Copy link

ghost commented Jan 7, 2021

also getting this issue, it appears to be related to the new changes to socket.io.

@idanalkhalid
Copy link

also getting this issue, it appears to be related to the new changes to socket.io.

do you solve your issue ?

@ghost
Copy link

ghost commented Jan 8, 2021

also getting this issue, it appears to be related to the new changes to socket.io.

do you solve your issue ?

sort of:
i added cors to the socketio section of laravel-echo-server.json
"socketio": {
"cors": {
"origin": true,
"methods": ["GET", "POST"],
"credentials": true
}
}
and then on the laravel-echo client options i added withCredentials:true

it seemed to stop the error, however, its not upgrading from polling to websocket.

@FlorianB385
Copy link

can you post your complete laravel-echo-server.json?

@hgaoping
Copy link
Author

hgaoping commented Jan 8, 2021

Just reinstall it, it may be a software package bug

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants