From 2b324fcfb514106f44b3194a93e1a0506f48fc83 Mon Sep 17 00:00:00 2001 From: Mark Gale Date: Fri, 9 Aug 2019 13:58:53 +0100 Subject: [PATCH] un-hardcoding websocket connection to data bridge for non localhost deployments Should fix #53 #60 #61 #66 --- src/db/bridge.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/db/bridge.js b/src/db/bridge.js index 46666c4..52d8574 100644 --- a/src/db/bridge.js +++ b/src/db/bridge.js @@ -10,7 +10,6 @@ import * as U from '../state/update' import { UnmountClosed } from 'react-collapse' const RETRY_INTERVAL = 1000 -const BRIDGE_URL = 'ws://localhost:14645' let clientConnectorSocket = null let checkConnectorInterval @@ -23,7 +22,7 @@ var bridgeAlive = true function tryOpenBridge() { try { - clientConnectorSocket = new WebSocket(BRIDGE_URL) + clientConnectorSocket = new WebSocket("ws://" + window.location.hostname + ":14645"); } catch (err) { State.apply('connect', 'bridge_status', U.replace('mixed_fail')) }