Giter Club home page Giter Club logo

Comments (3)

jondubois avatar jondubois commented on June 2, 2024

Thanks for this thorough description.
Looking at the suggested change, the functionality appears to be a bit different because it will always convert to a string. Currently, it will sometimes keep the message as a buffer (binary) and not a string. It's important that SC continue to support raw binary (even though that's an unusual use case).

About your problem. Since you are using different versions of the SC client and server, I would expect your package manager (e.g. npm or yarn) to point to two different versions of the ws module for the client and for the server. I would suggest looking into why the client and server are sharing the same version of the ws module/dependency. Normally npm can handle this case without issue. Maybe something to do with bundling step de-duplicating the dependency?

from socketcluster.

SSANSH avatar SSANSH commented on June 2, 2024

Thanks too for your quick answer my ws dependency is setup like this.

`
├─┬ [email protected]
│ └── [email protected]

├─┬ [email protected]
└── [email protected]
`

Client and server actualy not share the same version of ws.

note my issue is only on ping pong process.

I understand the raw thing maybe you can restrict the change like this

serversocket.js 
134d133
<     let messagePong = Buffer.from(messageBuffer).toString();
137c136
<     let isPong = messagePong === pongMessage;
---
>     let isPong = message === pongMessage;

in order to identify each time the ping correctly

from socketcluster.

jondubois avatar jondubois commented on June 2, 2024

@SSANSH OK. You could consider either downgrading socketcluster-client to an older version which uses an older ws module or upgrading it. Also, did you set the protocolVersion to 1 on the server? Like this: https://github.com/SocketCluster/socketcluster#compatibility-mode

You need to do this if using an older client with a new version of the server as the new server versions default to protocolVersion 2 which old clients don't fully understand (the difference is related to the ping format so could be related to your issue).

from socketcluster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.