Skip to content

Commit 6f9131e

Browse files
author
Paul Sokolovsky
committed
umqtt.simple: Add example for publishing over SSL.
1 parent d3d0b4f commit 6f9131e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

umqtt.simple/example_pub_ssl.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from umqtt.simple import MQTTClient
2+
3+
# Test reception e.g. with:
4+
# mosquitto_sub -t foo_topic
5+
6+
def main(server="localhost"):
7+
c = MQTTClient("umqtt_client", server, ssl=True)
8+
c.connect()
9+
c.publish(b"foo_topic", b"hello")
10+
c.disconnect()
11+
12+
if __name__ == "__main__":
13+
main()

0 commit comments

Comments
 (0)