Show HN: MQZiti – Zero Trust MQTT server and client
source link: https://github.com/ekoby/mqziti
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
MQTT => MQZiti
This project shows how to easily Zitify(run dark on zero trust overlay network) your Golang MQTT server and clients.
Setup
- Get your code -- clone this repo
- Get yourself an OpenZiti network and Ziti identities
- follow quickstart or, use Ziti Edge Developer Sandbox
- create a Ziti service that will be used to for MQTT communication
- add/enroll Ziiti identities
- build this project
this creates$ mkdir build && go build -o build ./...
mqziti_server
andmqziti_client
in your build directory
This following is assumed for the rest of this document:
- 'mqziti' - the name of the service we are going to use
server.json
- Ziti identity file for the serverclient.json
- Ziti identity for the client
Server
We use Mochi MQTT as base and implement a
Listener
that binds to the Ziti service.
Run the server
$ ./build/mqziti_server -identity server.json -service mqziti
You can check that the process has no listening sockets. This means that you need to open your firewall.
Client
We use Paho MQTT and implement a connector that connects to Ziti service.
You will need to run mqziti_client
twice for this test: one instance to subscribe, and one instance to publish.
Subscriber:
$ ./build/mqziti_client -identity client.json -service mqziti -topic /openziti
Publish something:
$ ./build/mqziti_client -identity client.json -service mqziti -topic /openziti -pub "Hello OpenZiti!"
You should see the message printed on the subscriber console.
Links
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK