Skip to content

Commit 6f9131e

Browse files
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

Lines changed: 13 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy