-
Notifications
You must be signed in to change notification settings - Fork 56
fix: make WebSocket path configurable for EMQX compatibility #307
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,7 @@ class BrokerConfig: | |
| client_id_prefix: str | ||
| topic_status: str | ||
| topic_packets: str | ||
| ws_path: str = "/mqtt" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing default was
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That does make sense. I’ll make the change today.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There were additional places where this incorrect default was set. Fixed and tested with 4f79a85 |
||
|
|
||
| @property | ||
| def name(self) -> str: | ||
|
|
@@ -304,6 +305,9 @@ def _load_brokers(self) -> list[BrokerConfig]: | |
| ), | ||
| iata, | ||
| ), | ||
| ws_path=str( | ||
| broker_settings.get("ws_path", "/mqtt") or "/mqtt" | ||
| ).strip(), | ||
| ) | ||
|
|
||
| if broker.is_letsmesh and iata in placeholder_iata_values: | ||
|
|
@@ -426,7 +430,7 @@ async def _async_create_client(self, broker: BrokerConfig): | |
| ) | ||
|
|
||
| if broker.transport == "websockets": | ||
| client.ws_set_options(path="/", headers=None) | ||
| client.ws_set_options(path=broker.ws_path, headers=None) | ||
|
|
||
| self.logger.info( | ||
| "[%s] Ready (status_topic=%s packets_topic=%s auth_token=%s)", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.