How can I send larger messages over WebSocket?

前端 未结 3 1180
温柔的废话
温柔的废话 2021-01-05 08:04

I am developing a WebSocket server with C# and I noticed that all the messages that coming from the browser (Chrome in that case) using the send() method are 126 chars lengt

相关标签:
3条回答
  • 2021-01-05 08:10

    I know for a fact that you can send messages larger than 126 characters,
    I am able to send data over protobuf that contains strings that themselves contain 126 characters. http://www.websocket.org/echo.html
    If you look at this website you can test out your messages. (Note this does not use fragments)

    0 讨论(0)
  • 2021-01-05 08:23

    WebSocket messages can be of any size. However, large messages are usually transmitted in multiple parts (fragments) to avoid head-of-line blocking. See the WebSockets I-D for details.

    0 讨论(0)
  • 2021-01-05 08:27

    That is not correct what you said DTB. Sending should definitely support more than 126 chars. It is a matter of properly formatting your output. If we were limited to 126 chars there would be no signalling servers for WebRTC. I will code this send message function and post it on here when I finish.

    0 讨论(0)
提交回复
热议问题