Giter VIP home page Giter VIP logo

Comments (6)

ashtum avatar ashtum commented on May 23, 2024

Do you mean multiplexing in WebSocket? If so, there is no standardized method for multiplexing messages within a single stream. This task is considered a higher-level responsibility for the user. For instance, if you are working with JSON messages, you might structure them as follows:

{
 "stream_id": "1",
  "payload": "..."
}

from beast.

djn3m0 avatar djn3m0 commented on May 23, 2024

Do you know any project that has implemented this?

from beast.

ashtum avatar ashtum commented on May 23, 2024

Do you know any project that has implemented this?

Not that I'm aware of. but it shouldn't be difficult to implement. what is the message format that you are using?

from beast.

djn3m0 avatar djn3m0 commented on May 23, 2024

I'm trying to write a WebSocket tunnel that can accept multiple TCP connection and send them through WebSocket.

from beast.

ashtum avatar ashtum commented on May 23, 2024

Your message format should be in binary. A straightforward method of multiplexing involves appending a single byte to the start of each message, indicating the stream's state and ID. You may find the followings useful: https://ckousik.github.io/gsoc/2017/06/16/WebSocket-Multiplexer-Overview.html
https://github.com/xtaci/smux

from beast.

djn3m0 avatar djn3m0 commented on May 23, 2024

Cool thanks.

from beast.

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.