{"id":1367,"date":"2024-02-08T18:11:28","date_gmt":"2024-02-08T16:11:28","guid":{"rendered":"https:\/\/www.rocworks.at\/wordpress\/?p=1367"},"modified":"2024-02-08T18:11:28","modified_gmt":"2024-02-08T16:11:28","slug":"tcp-mqtt-tcp-bridge","status":"publish","type":"post","link":"https:\/\/www.rocworks.at\/wordpress\/?p=1367","title":{"rendered":"TCP &#8211; MQTT &#8211; TCP Bridge"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Some weeks ago, someone asked at the\u202f<a href=\"https:\/\/www.linkedin.com\/feed\/hashtag\/?keywords=hivemq&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7161384874350682112\">#HiveMQ<\/a>\u202fSlack channel if there is any way to run SSH\u202fover\u202fMQTT\u2026<br>\u00a0<br>\ud83d\udc49\u202fStrange idea? I liked it, and I want to share the TCP-MQTT-TCP bridge I made weeks ago.\u00a0<br>\u00a0<br>\ud83e\udd14\u202fUse Case? Imagine you have IoT\u2019s connected to a central MQTT broker and you want to connect from one to another via SSH, transfer files, expose services, a Webpage, without exposing ports to the public internet or creating a VPN.\u00a0<br>\u00a0\u00a0<br>\u26a0\ufe0f\u00a0Be careful and please evaluate and consider the possible security impacts before using this &#8220;<strong>backdoor man<\/strong>&#8221; &#8230; the doors &#8230;<br>\u00a0<br>\u26a0\ufe0f\u202fAnd transferring files over MQTT may increase your cloud bill\u202f\ud83e\udd11\u00a0<br>\u00a0<br>\ud83d\udc49It&#8217;s on <a href=\"https:\/\/github.com\/vogler75\/TCP-MQTT-TCP-Bridge\">\u202fGitHub<\/a>, it is just a draft and can be used as a template to be extended by your needs.\u202f\u00a0<br>\u00a0<br>\ud83d\udc40\u202fHow to? Start the client.js script at the destination host &#8211; or more precisely at a node in the local network where the destination node runs &#8211; and start the server.js script on the source node from where you want to connect to the remote\/destination host and port. For example, if there is a SSH server running on the destination host+port, then you can do a SSH localhost -p 8080 -l username at your source node, and you will get a SSH connection from the source node to the destination node. And the data is transmitted over MQTT topics.\u00a0<br>\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/overview.png\"><img loading=\"lazy\" decoding=\"async\" width=\"982\" height=\"650\" src=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/overview.png\" alt=\"\" class=\"wp-image-1368\" srcset=\"https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/overview.png 982w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/overview-300x199.png 300w, https:\/\/www.rocworks.at\/wordpress\/wp-content\/uploads\/2024\/02\/overview-768x508.png 768w\" sizes=\"auto, (max-width: 982px) 100vw, 982px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Some weeks ago, someone asked at the\u202f#HiveMQ\u202fSlack channel if there is any way to run SSH\u202fover\u202fMQTT\u2026\u00a0\ud83d\udc49\u202fStrange idea? I liked it, and I want to share the TCP-MQTT-TCP bridge I made weeks ago.\u00a0\u00a0\ud83e\udd14\u202fUse Case? Imagine you have IoT\u2019s connected to a central MQTT broker and you want to connect from one to another via SSH, transfer &hellip; <a href=\"https:\/\/www.rocworks.at\/wordpress\/?p=1367\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">TCP &#8211; MQTT &#8211; TCP Bridge<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67],"tags":[54],"class_list":["post-1367","post","type-post","status-publish","format-standard","hentry","category-mqtt","tag-mqtt"],"_links":{"self":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1367"}],"version-history":[{"count":1,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1367\/revisions"}],"predecessor-version":[{"id":1369,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1367\/revisions\/1369"}],"wp:attachment":[{"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocworks.at\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}