Open cnjackven opened 5 months ago
HI there
could you provide me your fixed-laravel-echo-server.json
config file?.
no clientConnectEndpoint and clientDisconnectEndpoint is not required
fixed-laravel-echo-server.json
{
"authHost": "http://test.com",
"authEndpoint": "/broadcasting/auth",
"clientConnectEndpoint": null,
"clientDisconnectEndpoint": null,
"clients": [
{
"appId": "8a92a751ea66edf8",
"key": "df5411b2e3ecc51673ddf374e6c07c31"
}
],
"database": "sqlite",
"databaseConfig": {
"redis": {
"port": 6379,
"host": "127.0.0.1",
"db": "0",
"password": ""
},
"sqlite": {
"databasePath": "/database/fixed-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": false,
"allowOrigin": "http://test.com",
"allowMethods": "GET, POST",
"allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
},
"firebaseAdmin": {
"enabled": false,
"configSource": null,
"databaseURL": null,
"channel": "private-firebase_admin"
},
"echoSever": null
}
I did not find the main problem, but we will try some solutions 1- Try setting transports to websockets in echo client config
window.Echo = new Echo({
broadcaster: 'socket.io',
host: 'test.com',
transports: ["websocket"],
auth: {
headers: {
Authorization:
'Bearer request token'
}
}
})
(sorry for my late response)
After deploying fixed-laravel-echo-server, the client side link keeps prompting 400 (Bad Request), can you help me?
"laravel-echo": "^1.16.1", "socket.io-client": "^4.7.5",
NGINX server
ERROR:
Access to XMLHttpRequest at 'http://test.com/socket.io/?EIO=3&transport=polling&t=OyJ3I6q' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
clientConnectEndpoint and clientDisconnectEndpoint must be set?