diff --git a/CHANGELOG.md b/CHANGELOG.md index c3ccf583..18a89fe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - The broken modules due to Socket.io change from last release [#1973](https://github.com/MichMich/MagicMirror/issues/1973) +- Add backward compatibilty for old module code in socketclient.js [#1973](https://github.com/MichMich/MagicMirror/issues/1973) ## [2.11.0] - 2020-04-01 diff --git a/js/socketclient.js b/js/socketclient.js index 7be9ce7d..d10c0d60 100644 --- a/js/socketclient.js +++ b/js/socketclient.js @@ -8,8 +8,12 @@ var MMSocket = function(moduleName) { self.moduleName = moduleName; // Private Methods + var base = "/"; + if ((typeof config !== "undefined") && (typeof config.basePath !== "undefined")) { + base = config.basePath; + } self.socket = io("/" + self.moduleName, { - path: config.basePath + "socket.io" + path: base + "socket.io" }); var notificationCallback = function() {};