commit 375191b516846cbc3c95c5991c86c8f9c388eb3c parent a54ba2ee83320d1ec6f3e43bcd79afe165095c7f Author: Martin Ashby <martin@ashbysoft.com> Date: Thu, 17 May 2018 20:28:12 +0000 Merge branch 'master' of github.com:MFAshby/unicornpaint Diffstat:
M | src/App.js | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/App.js b/src/App.js @@ -142,8 +142,8 @@ class App extends Component { } _connectWebsocket() { - // this._websocket = new WebSocket('ws://' + window.location.hostname + ':3001/ws') - this._websocket = new WebSocket('ws://shinypi:3001/ws') + let webSocketProto = window.location.protocol === "https" ? "wss" : "ws" + this._websocket = new WebSocket(`${webSocketProto}://${window.location.host}/ws`) this._websocket.onmessage = this._onMessage this._websocket.onopen = this._onOpen this._websocket.onclose = this._onClose