multiformats / multiaddr

Composable and future-proof network addresses
https://multiformats.io/multiaddr
MIT License
419 stars 84 forks source link

Adding MQTT protocol #106

Open ConsciousCode opened 4 years ago

ConsciousCode commented 4 years ago

IoT seems to be a good use-case of libp2p in general, so support should be added for IoT protocols like MQTT. Luckily it already has a path-like addressing syntax, so it could be considered a (restricted) type of path protocol, eg /mqtt/stat/tasmota/POWER. This can then be combined with host resolution protocols, eg /mdns/mqtt.local/tcp/1883/tls/sni/mqtt/stat/tasmota/POWER

Stebalien commented 4 years ago

It looks like MMQT is a protocol that could run over libp2p, but it doesn't look like it would work as a libp2p transport.

mikeal commented 4 years ago

I bet @mcollina has some ideas about this ;)

ConsciousCode commented 4 years ago

I don't know if I'm stretching the definition of "transport", but topics can be thought of as producing/consuming short strings and thus addressing resources, like in the example provided which addresses an IoT device's power status

ntninja commented 3 years ago

Regardless of whether MQTT is a good use-case for libp2p, I think it should be added as a terminator protocol to the multiaddr protocol list.

mcollina commented 3 years ago

MQTT is based on a client-server logic. You can run mqtt from a client to a server on any duplex connection. Originally it was run even on RS232.

On the JS side, it can run on any Node.js Duplex (even on browsers).