Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message size limit for socket.io #3135

Closed
techwizardg opened this issue Dec 5, 2017 · 2 comments
Closed

Message size limit for socket.io #3135

techwizardg opened this issue Dec 5, 2017 · 2 comments

Comments

@techwizardg
Copy link

We have a socket.io server that supports websockets as transport. Would like to know the message size limit for socket.io (i.e. as per documentation maxHttpBufferSize is only for polling and not for websockets). We send huge data over websocket from client to server to perform some operations on it. It takes a lot of time for response as i assume it is coming over multiple chunks and what is the default value on the message size limit for socket.io when transport is websockets.

@Chopinsky
Copy link

As raised in issue #3125, if a message is larger than 300MB, socket parser will crash on creating the JSON object to be sent. It would be better to break your traffic into smaller trunks and send them separately.

@darrachequesne
Copy link
Member

For future readers: there are two parameters to take in account when sending big files:

  • maxHttpBufferSize, which defaults to 1MB and applies to both the HTTP long-polling and WebSocket connections
  • pingTimeout, which default to 5s, which is a bit low when uploading big files (if the client is uploading something while receiving a PING from the server, it may not have the time to send a PONG back)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants