From 7b56817ae60f0e010792cd60e5000fc2edb9bbba Mon Sep 17 00:00:00 2001 From: Leon Kiefer Date: Tue, 18 Feb 2020 17:09:25 +0100 Subject: [PATCH 1/2] use relative path for socket.io fix #1934 --- CHANGELOG.md | 1 + index.html | 2 +- js/socketclient.js | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1e671f4..16babe83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fix regression in currentweather module causing 'undefined' to show up when config.hideTemp is false - Fix FEELS translation for Croatian - Fixed weather tests [#1840](https://github.com/MichMich/MagicMirror/issues/1840) +- Fixed Socket.io can't be used with Reverse Proxy in serveronly mode [#1934](https://github.com/MichMich/MagicMirror/issues/1934) ### Updated - Remove documentation from core repository and link to new dedicated docs site: [docs.magicmirror.builders](https://docs.magicmirror.builders). diff --git a/index.html b/index.html index d8604256..5a46bb72 100644 --- a/index.html +++ b/index.html @@ -37,7 +37,7 @@
- + diff --git a/js/socketclient.js b/js/socketclient.js index baead68e..62341f27 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -8,7 +8,9 @@ var MMSocket = function(moduleName) { self.moduleName = moduleName; // Private Methods - self.socket = io("/" + self.moduleName); + self.socket = io("/" + self.moduleName, { + path: window.location.pathname + "/socket.io" + }); var notificationCallback = function() {}; var onevent = self.socket.onevent; From 6aeec81072f19bbe6670efa8b4a2542a8651a279 Mon Sep 17 00:00:00 2001 From: Leon Kiefer Date: Wed, 19 Feb 2020 20:58:58 +0100 Subject: [PATCH 2/2] removed additional slash from the socket.io path --- js/socketclient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/socketclient.js b/js/socketclient.js index 62341f27..5e138636 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -9,7 +9,7 @@ var MMSocket = function(moduleName) { // Private Methods self.socket = io("/" + self.moduleName, { - path: window.location.pathname + "/socket.io" + path: window.location.pathname + "socket.io" }); var notificationCallback = function() {};