-
Notifications
You must be signed in to change notification settings - Fork 727
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
Maybe improper implemention of "Host" in websocket header #666
Comments
Are you sure this is the cause of the problem? A Host header with a port in it is standard, even if it is the default value. I've just tested with Paho Python connecting to a WSS -> nginx -> mosquitto and it all worked fine for me. Perhaps there is some aspect of your configuration that is different. |
Yes,I compare the request when using the emqx-client and paho.mqtt.python, the
Yes.Maybe the wrong side is the server that I wanted to connect. I just noticed that other client(implemented in golang) seems using a difference way to make the request header. |
I just stumbled across the same issue, but with a different perspective. My workaround:
|
Thank you, this is now fixed and will be part of the next release. |
Closes #666. Thanks to hulb and Oliver Rahner.
I don't think it's valid to always remove the port.
The RFC said:
The RFC isn't very clear whether this apply to Host header. Anyway if we connect to wss://hostname:1234 I don't see why we should not include port in the Host header. All client I known (browsers, curl, Python requests) don't omit it, they only omit it when it's the default value. |
https://github.com/eclipse/paho.mqtt.python/blob/9782ab81fe7ee3a05e74c7f3e1d03d5611ea4be4/src/paho/mqtt/client.py#L3726
at here, the
Host
of header will be conbined withhost
andport
. let's say if I want to connect towss://mqtt.example.com
, and I should write the code like belowthen actual request header
Host
would beIt's quite unusual for a tls request brings the port in
Host
header if the port is 443. And the golang implemention Eclipse Paho Go doesn't do the same.And it brings me a problem. I use nginx at the front of a real mqtt server, And when I try to connect it through
wss
,it can't handle theHost
(with the port of 443) properly.The text was updated successfully, but these errors were encountered: