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

Find no 'path=' option for single messages #732

Open
sosyco opened this issue Jun 25, 2023 · 1 comment
Open

Find no 'path=' option for single messages #732

sosyco opened this issue Jun 25, 2023 · 1 comment
Labels
Status: Available No one has claimed responsibility for resolving this issue. Status: More info needed More information needed from issue author

Comments

@sosyco
Copy link

sosyco commented Jun 25, 2023

Hi,
I want to send a single message to wss://mydomain/mqtt behind a proxy.

Mosquitto and NGINX work fine.
I can send messages via websocket to the defined path via MQTTX.
Same via full-client-code.

BUT using the single function, I see no option for path ("/mqtt")

If I use websocket without path but a special domain (wss://mqtt.mydomain), all works fine. But this is not my intention.

A code example:

import paho.mqtt.publish as mqttpublish
import certifi
...
mqtt_auth = { 'username': USER, 'password': PASSWORD }
# where can i set the path='/mqtt'?
mqttpublish.single(TOPIC, payload=MSG, qos=1, retain=True, hostname=BROKER, port=443, client_id=CLIENTID, keepalive=60, will=None, auth=mqtt_auth, tls={'ca_certs':certifi.where()}, transport='websockets')
@github-actions github-actions bot added the Status: Available No one has claimed responsibility for resolving this issue. label Jun 25, 2023
@sosyco sosyco changed the title Find no path option for single messages Find no 'path=' option for single messages Jun 25, 2023
@MattBrittan
Copy link
Contributor

/mqtt should be the default path; so you should not need to specify this.

It does not look like single provides any way to change this; for now you would need to copy the code (it's relatively short) and add a call to ws_set_options.

@MattBrittan MattBrittan added the Status: More info needed More information needed from issue author label Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available No one has claimed responsibility for resolving this issue. Status: More info needed More information needed from issue author
Projects
None yet
Development

No branches or pull requests

2 participants