{"id":8762,"date":"2022-03-12T21:49:07","date_gmt":"2022-03-13T02:49:07","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=8762"},"modified":"2022-03-12T21:49:40","modified_gmt":"2022-03-13T02:49:40","slug":"8762","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=8762","title":{"rendered":"Reverse Proxying WebSockets through mod_proxy &#8212; HTTP Failback"},"content":{"rendered":"<p>I&#8217;ve been successfully <a href=\"https:\/\/www.rushworth.us\/lisa\/?p=358\">reverse proxying MQTT over WebSockets via Apache HTTPD<\/a> for quite some time now. The last few weeks, my phone isn&#8217;t able to connect. There&#8217;s no good rational presented (and manually clicking the &#8220;send data&#8221; button on my client successfully connects). It was time to upgrade the server anyway. Once I got the latest Linux distro on the server, I couldn&#8217;t connect <em>at all<\/em> to my MQTT server. The error log showed <tt>AH00898: Error reading from remote server returned by \/mqtt<\/tt><\/p>\n<p>Evidently, httpd 2.4.47 added functionality to upgrade and tunnel in accordance with RFC 7230. And that doesn&#8217;t work at all in my scenario. Haven&#8217;t dug in to the <em>why<\/em> of it yet, but adding <tt>ProxyWebsocketFallbackToProxyHttp Off<\/tt> to the reverse proxy config allowed me to successfully communicate with the MQTT server through the reverse proxy.<\/p>\n<p><a href=\"https:\/\/www.rushworth.us\/lisa\/?attachment_id=8763\" rel=\"attachment wp-att-8763\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-8763\" src=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/wstunnel_http.png\" alt=\"\" width=\"1581\" height=\"270\" srcset=\"https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/wstunnel_http.png 1581w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/wstunnel_http-300x51.png 300w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/wstunnel_http-1024x175.png 1024w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/wstunnel_http-768x131.png 768w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/wstunnel_http-1536x262.png 1536w, https:\/\/www.rushworth.us\/lisa\/wp-content\/uploads\/2022\/03\/wstunnel_http-750x128.png 750w\" sizes=\"auto, (max-width: 1581px) 100vw, 1581px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been successfully reverse proxying MQTT over WebSockets via Apache HTTPD for quite some time now. The last few weeks, my phone isn&#8217;t able to connect. There&#8217;s no good rational presented (and manually clicking the &#8220;send data&#8221; button on my client successfully connects). It was time to upgrade the server anyway. Once I got the &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63,30],"tags":[1122,1558,1559,876,187,1556,1557,877],"class_list":["post-8762","post","type-post","status-publish","format-standard","hentry","category-home-automation","category-system-administration","tag-apache-httpd","tag-mod_proxy","tag-mod_proxy_wstunnel","tag-mosquitto","tag-mqtt","tag-reverse-proxy","tag-reverse-proxy-websockets","tag-websockets"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8762"}],"version-history":[{"count":2,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8762\/revisions"}],"predecessor-version":[{"id":8765,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/8762\/revisions\/8765"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}