using paho python client to test mosquitto over websockets
Hi,
i can use paho python client to pub/sub with local broker on port 1883 or 8883.
but when i change to test websockets on its port 8080, there is no return for python script.
i use example code to test common broker, test.mosquitto.org, same result.
am i wrong somewhere? for mosquitto over websockets, which paho client can be used? js only?
example.py :
#!/usr/bin/python
import sys
import paho.mqtt.client as mqtt
def on_connect(mqttc, obj, flags, rc):
print("connect rc: "+str(rc))
def on_message(mqttc, obj, msg):
print(
def on_publish(mqttc, obj, mid):
print(
def on_subscribe(mqttc, obj, mid, granted_qos):
print(
mqttc = mqtt.Client()
mqttc.on_message = on_message
mqttc.on_connect = on_connect
mqttc.on_publish = on_publish
mqttc.on_subscribe = on_subscribe
mqttc.connect(
mqttc.subscribe
mqttc.loop_
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- mosquitto Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Roger Light
- Solved:
- Last query:
- Last reply: