laravel-echo-server
laravel-echo-server copied to clipboard
Invalid namespace
I'm trying to connect to my webserver via laravel echo but got the following response
32:44/socket.io,"Invalid namespace"
I'm using the following configuration
location /socket.io {
proxy_pass http://127.0.0.1:6001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
And laravel echo configuration
window.io = require('socket.io-client');
window.Echo = new Echo({
broadcaster: 'socket.io',
host: 'https://my-site.com/socket.io',
auth: {
headers: {
'Authorization': 'Bearer some token here'
}
}
});
window.Echo.join('channel').joining((user) => {
console.log('joining');
}).leaving((user) => {
console.log('leaving');
})
32:44/socket.io,"Invalid namespace"
Well, it means the namespace is not valid
use this instead host: 'https://my-site.com',