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

HTTP header matching should be case insensitive to support more clients #13

Closed
nibarius opened this issue Jun 4, 2022 · 2 comments
Closed
Assignees

Comments

@nibarius
Copy link

nibarius commented Jun 4, 2022

Some MQTT clients, such as HiveMQ uses all lowercase in the HTTP headers during a websocket handshake.

KMQTT does a case sensitive regex match against, for example, Sec-WebSocket-Protocol. Due to this it's not possible to use WebSockets to connect to KMQTT from a client using on HiveMQ.

It would be great if case insensitive matching could be used when matching against http headers.

For reference, here's an example of what the request and response looks like during the handshake:

GET / HTTP/1.1
host: 192.168.22.52:1884
upgrade: websocket
connection: upgrade
sec-websocket-key: GDDymPLXlAntP0fSTArBCg==
origin: http://192.168.22.52:1884
sec-websocket-protocol: mqtt
sec-websocket-version: 13

HTTP/1.1 400 Bad Request
@davidepianca98 davidepianca98 self-assigned this Jun 5, 2022
@davidepianca98
Copy link
Owner

Hello, thank you very much for letting me know, I just released version 0.3.2 that should fix this issue. If you still find anything wrong please feel free to reopen.

@nibarius
Copy link
Author

nibarius commented Jun 5, 2022

I tested 0.3.2 and it's working fine together with HiveMQ. Thanks.

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