feathers: socket.io-client v 3.0.1 incompatible
Ran into an issue with @feathersjs/socketio-client not working with the latest version of socket.io-client (3.0.1) It fails to establish the socket connection returning (bad handshake)
Steps to reproduce
create a new feathersjs application that uses socketio
install these packages in your frontend: @feathersjs/feathers@4.5.10 @feathersjs/socketio-client@4.5.10 socket.io-client@3.0.1
in your frontend set up the socket connection following the code from the @featherjs/socketio-client documentation.
const feathers = require('@feathersjs/feathers');
const socketio = require('@feathersjs/socketio-client');
const io = require('socket.io-client');
const socket = io('http://api.feathersjs.com');
const app = feathers();
// Set up Socket.io client with the socket
app.configure(socketio(socket));
Expected behavior
Should successfully establish the connection.
Actual behavior
gets a (bad handshake) return, and then proceeds to try again repeatedly with no success.
If I downgrade socket.io-client to version 2.3.0 it works without an issue. I am not sure if this is a bug with @feathersjs/socketio-client, socket.io-client v3.0.1 or if there is just some additional configuration necessary to get socket.io-client v3.0.1 working, in which case the documentation should probably be updated.
System configuration
Module versions (especially the part that’s not working): @feathersjs/feathers 4.5.10 @feathersjs/socketio-client 4.5.10 socket.io-client 3.0.1
NodeJS version: 12.18.0 Operating System: Windows 10
Browser Version: Chrome v86.0.4240.198
React Native Version:
Module Loader:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
Due to the Pandemic, having lost most sponsors and with contributors needing to focus on their own lives and businesses first, there currently is no set release date. Sponsorships are always welcome and with two or three more companies or individuals at the gold or platinum tier I’d be willing to commit to a more fixed date.
Two days ago there was a socket.io update with a major security change that broke all my apps. More info can be found here https://socket.io/blog/socket-io-2-4-0/ My workaround was to install on my server
npm install socket.io@2.3.0 --save
. However, that is not the most recommended solution. Any ideas on how to address this? https://github.com/socketio/socket.io/releases/tag/2.4.0Correct. You can not upgrade your
socket.io-client
dependencies to version 3. Because of some pretty significant breaking changes this upgrade can not happen until Feathers v5.