How to trigger websocket frame fragmentation from the client?

前端 未结 1 579
深忆病人
深忆病人 2021-01-19 04:12

I\'m building a Web socket server, however, for testing purposes, I\'d like Chrome or Firefox or any other browser to send the message fragmented so I can test my implementa

相关标签:
1条回答
  • 2021-01-19 04:25

    The Javascript WebSocket API does not expose this option. I recently ran into the same frustration when some more modern browsers (A Chromium derivative) was unpredictably sending fragmented WebSocket frames.

    For testing I rolled my own TCP client sending pre-calculated fragmented WebSocket frames. Not ideal, but it got the job done, and AFAIK there's no alternative yet.

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