From 6f9131e59a4c27691b378cd027151f8d0352d976 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 3 Jul 2016 13:56:16 +0300 Subject: [PATCH] umqtt.simple: Add example for publishing over SSL. --- umqtt.simple/example_pub_ssl.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 umqtt.simple/example_pub_ssl.py diff --git a/umqtt.simple/example_pub_ssl.py b/umqtt.simple/example_pub_ssl.py new file mode 100644 index 0000000..9d2f62d --- /dev/null +++ b/umqtt.simple/example_pub_ssl.py @@ -0,0 +1,13 @@ +from umqtt.simple import MQTTClient + +# Test reception e.g. with: +# mosquitto_sub -t foo_topic + +def main(server="localhost"): + c = MQTTClient("umqtt_client", server, ssl=True) + c.connect() + c.publish(b"foo_topic", b"hello") + c.disconnect() + +if __name__ == "__main__": + main()