6

Show HN: MQZiti – Zero Trust MQTT server and client

 2 years ago
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.
neoserver,ios ssh client

MQTT => MQZiti

This project shows how to easily Zitify(run dark on zero trust overlay network) your Golang MQTT server and clients.

Setup

  1. Get your code -- clone this repo
  2. Get yourself an OpenZiti network and Ziti identities
  3. build this project
    $ mkdir build && go build -o build ./...
    this creates mqziti_server and mqziti_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 server
  • client.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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK