From cd48bffd70985c4984bd7a422d4bb4d511ff3698 Mon Sep 17 00:00:00 2001 From: r3dDoX Date: Tue, 9 May 2017 22:09:34 +0200 Subject: [PATCH] handle tls protocol when in heroku instance --- client/js/communication/serverApi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/js/communication/serverApi.js b/client/js/communication/serverApi.js index 7dfa8bc9..e9f51e79 100644 --- a/client/js/communication/serverApi.js +++ b/client/js/communication/serverApi.js @@ -5,7 +5,7 @@ import * as messages from '../../../shared/messages/messages'; import {MessageType} from '../../../shared/messages/messageType'; import {SessionChoice} from '../../../shared/session/sessionChoice'; -const protocol = (window.location.hostname === 'localhost' || window.location.hostname.startsWith('192.168.99')) ? 'ws' : 'wss'; +const protocol = (process.env.NODE && ~process.env.NODE.indexOf('heroku')) ? 'wss' : 'ws'; const serverAddress = `${protocol}://${window.location.host}`; let webSocket;