-
Notifications
You must be signed in to change notification settings - Fork 227
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
MqttOptions::new should be refactored #434
Comments
Also the Lines 609 to 631 in 2f11546
I wrote my own logic to handle this: https://github.com/EdJoPaTo/mqttui/blob/4759bef5005aeb9aef1c8129aef1a021ff36cb3c/src/main.rs#L29-L60 |
Maybe also relevant for this discussion is my decision against using MqttOptions as URL query parameters as they would be mixed up with the WebSocket connection URL. Also the username/password are for the MQTT connection itself. keeping it inside the URL will send them to the web server too. The web server does not care about the MQTT auth and also might have its own auth requiring different username/password than the MQTT auth. I like the idea of combining it to only set one URL but its incorrect and might create conflicts in the long run. Maybe that should be considered when refactoring MqttOptions. Personally I would just get rid of the |
MqttOptions::new(client_id, host, port)
is only relevant for TCP.For WebSockets on the other hand
host
has to be an URL and not only the hostname (includingws://
). The Port is ignored (see #270). Looking at theTransport::Unix
options I don't see a use for the port either. So host and port differ based on the chosen transport.Personally I would include host and port into the Transport enum then or provide different
new
methods likeMqttOptions::new_tcp()
.If possible also allow for the same
MqttOptions
with MQTT v3 / v5. Currently they are split which makes usage harder.The text was updated successfully, but these errors were encountered: