diff options
author | Martin Ashby <martin@martin-laptop.lan> | 2018-05-17 20:42:44 +0100 |
---|---|---|
committer | Martin Ashby <martin@martin-laptop.lan> | 2018-05-17 20:42:44 +0100 |
commit | 8add16bd0fff15dffe3b0a7931052c5218108cc1 (patch) | |
tree | 48a9fa554e0cdc09e3718a977c625903deacc9b0 /src | |
parent | 10e7ce5764b3b456e1f909cd6b6a90f076c2e014 (diff) | |
download | unicornpaint-8add16bd0fff15dffe3b0a7931052c5218108cc1.tar.gz unicornpaint-8add16bd0fff15dffe3b0a7931052c5218108cc1.tar.bz2 unicornpaint-8add16bd0fff15dffe3b0a7931052c5218108cc1.tar.xz unicornpaint-8add16bd0fff15dffe3b0a7931052c5218108cc1.zip |
Set ws vs wss protocols
Diffstat (limited to 'src')
-rw-r--r-- | src/App.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |