Unable to connect with `laravel-echo-server` with latest `socket.io-client`
See original GitHub issueDescribe the bug
Whenever I try to connect with laravel-echo-server
with the latest socket.io-client
and laravel-echo
, it does not connect to the laravel-echo-server, however If I downgrade socket.io-client
version to 2.3.0, it works like charm.
I don’t know why it is failing
To Reproduce Steps to reproduce the behavior:
- Install
laravel-echo
andsocket.io-client
on freshvue
project. - Add this code to
src/main.js
window.io = require('socket.io-client');
window.Echo = new Echo({
broadcaster: "socket.io",
host: "http://localhost:6001",
transports: ["websocket"]
});
window.Echo.channel('user-channel')
.listen('UserEvent', e => {
console.log(e);
alert(e.name);
});
window.Echo = Echo;
- But, If I downgrade to v2.3.0, then it works, same version as of
socket.io
inlaravel-echo-server/package.json
Expected behavior
It should connect to the laravel-echo-server
but won’t connect
Additional context
But, if the socket.io-client
downgrade to v2.3.0 it works, not working with the latest version.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:9
Top Results From Across the Web
Laravel-echo-server and socket.io-client does't work on server
I use laravel echo server and socket.io-client and running at localhost is work at port 6001 and I config at server and use...
Read more >Troubleshooting connection issues | Socket.IO
You are trying to reach a plain WebSocket server; The server is not reachable; The client is not compatible with the version of...
Read more >Broadcasting with Laravel Echo, laravel-echo-server and ...
Broadcasting with Laravel Echo, laravel-echo-server and socket.io won't work · Laravel is running on port 8001 · Redis is running on 6379 ·...
Read more >laravel-echo-server - npm
Laravel Echo Node JS Server for Socket.io. Latest version: 1.6.3, last published: a year ago. Start using laravel-echo-server in your ...
Read more >socket.io+ laravel echo not working in production in ubuntu
I'm using socket.io and laravel echo server with Redis and also SSL ... allow UFW 6001 port. getting (failed)net::ERR_CONNECTION_TIMED_OUT error on console ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://socket.io/docs/v4/client-installation/index.html
Because socket.io is using version 2 https://github.com/tlaverdure/laravel-echo-server/blob/6a4125d96d238c2e99c09c9918925ef6322aca35/package.json#L32 the client must also use version 2