-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Websocket data will be truncated if HTTP header is too long #208
Comments
Is this a problem you are seeing in practice? If so, could you give me an example? A single header >1024 bytes is pretty big. |
We have a web site based on Laravel framework 5.2, when user login, it will open a websockets channel using paho-javascript library from browser to Nginx reverse proxy, it forwards to mosquitto websockets server (in order to prevent CSRF problem):
Therefore it will also forwards the full HTTP headers to mosquitto, And here is the PCAP file: |
I've had it confirmed that |
This is a very practical issue. We share the same domain for all services (including the "/mqtt" websocket endpoint). Therefor all requests will get all the cookies. Cookies with several KB are really nothing special. So, I think the default should be at least 4-8KB. Currently I work around it with a HAProxy config: |
It doesn't looks like this made it into a release. What would it take to get it there? |
@memoryhole I'm pleased to say it is in version 1.6 (so I'm closing this now). |
Since libwebsockets V1.7.0, it adds a max_http_header_data in info struct:
https://github.com/warmcat/libwebsockets/blob/master/changelog#L370
Therefore if mosquitto's websocket interface receives a HTTP header over 1024 bytes, all additional bytes will be dropped. Maybe it is better to make this value configurable at mosquitto config file?
The text was updated successfully, but these errors were encountered: