-
-
Notifications
You must be signed in to change notification settings - Fork 318
Description
I work with a server in version [email protected] (why its not available on tags of repository).
And a client on version [email protected]
I have issue with following code :
node_modules/socketcluster-server/serversocket.js
`
// Receive incoming raw messages
this.socket.on('message', async (messageBuffer, isBinary) => {
let message = isBinary ? messageBuffer : messageBuffer.toString();
this.inboundReceivedMessageCount++;
let isPong = message === pongMessage;
`
problem is that isBinary function is not implemented on ws link to the version of the client [email protected]
Thats means when pong arrive isBinary is set to false
and we cannot validate the condition let isPong = message === pongMessage;
What to you think to change this code by :
node_modules/socketcluster-server/serversocket.js
`
// Receive incoming raw messages
this.socket.on('message', async (messageBuffer) => {
let message = Buffer.from(messageBuffer).toString();
this.inboundReceivedMessageCount++;
let isPong = message === pongMessage;
`
This will work on all case with and without isBinary.
or other option is to specify an option to keep the compliance with old client by running this code conditionnaly.
I know the best options is to update server and client, I will do this however this will be more easy to keep compliance during migration.