question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebSocket does not handle fragmentation or messages >1 MB, disconnects silently

See original GitHub issue

The WebSocket implementaiton for the Chrome DevTools does not seem to handle either fragmentation (continuation frames) or messages that are larger than 1 MB in size.

This problem is reproducible after connecting to the webSocketDebuggerUrl of a page and either sending fragmented messages or messages above 1 MB in size.

In both cases the result is silent failure of the tcp connection. The error is found upon next write when the connection returns (among other things)write tcp 127.0.0.1:50872->127.0.0.1:9222: write: broken pipe.

I spent some time tracking down these two issues and came to the following conclusions:

  1. Chrome does not support websocket fragmentation (continuation frames), they remain unimplemented at the time of writing (net/server/web_socket_encoder.cc#86)

  2. The underlying HTTP connection does not support bigger payloads than 1MB, I believe the reason is the kDefaultMaxBufferSize, defined here: net/server/http_connection.h#33

    When we send messages larger than 1MB, Chrome logs the following:

    [89253:55299:0616/194024.005586:ERROR:http_connection.cc(37)] Too large read data is pending: capacity=1048576, max_buffer_size=1048576, read=1048576
    

The biggest use-case for this is probably sending large scripts over CDP, however, the current behavior does lead to hard-to-diagnose bugs. It would be nice if CDP could support WebSocket fragmentation, and at the very least provide useful error messages when it cannot handle a command.

Related issues:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
pavelfeldmancommented, Jul 5, 2017

I’m bumping it to a 100MB here - can’t do anything smart here since it needs to stay non-blocking.

0reactions
matthewmuellercommented, Jul 6, 2017

that’s wonderful news @pavelfeldman!

sorry late follow-up here, the large screenshots turned out to be a bug in my code. sorry for the false alarm and thanks for checking it out @mafredri!

Read more comments on GitHub >

github_iconTop Results From Across the Web

websocket client disconnects on sending large data
I found solution to this.The problem here is with the data size. Web socket protocol has its limitation on ...
Read more >
NSX-T Data Center Administration Guide | VMware Docs
APIs to Configure vSphere Distributed Switch on NSX-T Data Center 80 ... Zero means no KEEPALIVE messages are sent between the BGP neighbors....
Read more >
Writing WebSocket servers - Web APIs | MDN
Message Fragmentation ​​ The FIN and opcode fields work together to send a message split up into separate frames. This is called message...
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >
Server-Sent Events: the alternative to WebSockets you should ...
On the contrary, the WebSocket protocol has no support, by default, for multiplexing. Multiple WebSockets to the same host will each open their ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found