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

Eventlet forces an 8MB max size on WebSocket packets #319

Closed
miguelgrinberg opened this issue Jul 5, 2023 · 3 comments
Closed

Eventlet forces an 8MB max size on WebSocket packets #319

miguelgrinberg opened this issue Jul 5, 2023 · 3 comments

Comments

@miguelgrinberg
Copy link
Owner

Discussed in miguelgrinberg/Flask-SocketIO#1998

Eventlet imposes its own maximum frame length, which conflicts with the maximum configured in this package. The solution is to reconfigure eventlet to use the same max length as this package.

@Pxmme
Copy link

Pxmme commented Oct 8, 2023

Hi there,

Sorry for commenting on a closed issue. I see that you've implemented a fix, but I'm unsure about how to use it. :(

How can I increase the max size for packets being received by my socketIO server when using eventlet?

What's the option to pass to it?

Here is how I currently initialize things:

socketio = SocketIO(app, cors_allowed_origins="*", logger=False, engineio_logger=False, ping_timeout=300000, ping_interval=300000)
if __name__ == '__main__':
    eventlet.wsgi.server(eventlet.listen(('0.0.0.0', 5000)), app, log_output=True)

Yeah, I've used insane ping timeouts and intervals lol, I'm currently battling with websockets disconnecting whenever my users send a packet that's too big D: (they are sending recorded audios to my server so size can vary)

Thanks in advance for any kind of help you may offer me, I'll truly appreciate it!

Cheers,
Pxmme

EDIT : I am using the latest version of python-engineio

pip show python-engineio
Name: python-engineio
Version: 4.7.1

@miguelgrinberg
Copy link
Owner Author

@Pxmme Pass the max_http_buffer_size argument when you create your SocketIO object to configure the maximum allowed size. The default is 1MB.

@Pxmme
Copy link

Pxmme commented Oct 8, 2023

@miguelgrinberg Yep, this fixed my issue. I added 10010241024 to make sure to allow 100MB files tops.

Anyway, thanks a lot for your help! I appreciate it. Have a great sunday!

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

2 participants