diff options
Diffstat (limited to 'src/api/socket.js')
| -rw-r--r-- | src/api/socket.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/api/socket.js b/src/api/socket.js index 549ed6a9..283e02e7 100644 --- a/src/api/socket.js +++ b/src/api/socket.js @@ -6,7 +6,11 @@ let requestIdCounter = 0; const callbacks = {}; export function setupSocketConnection(onConnect) { - socket = io.connect(window.location.protocol + "//" + window.location.hostname + ":" + window.location.port); + let port = window.location.port; + if (process.env.NODE_ENV !== 'production') { + port = 8081 + } + socket = io.connect(window.location.protocol + "//" + window.location.hostname + ":" + port); socket.on("connect", onConnect); socket.on("response", onSocketResponse); } |
