Merge pull request #565 from weaveworks/563-wss-websockets

Support wss for secure websockets when page was loaded over ssl
This commit is contained in:
Paul Bellamy
2015-10-20 10:13:54 +01:00
3 changed files with 2550 additions and 2540 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,7 @@
// see main.js for the real entrypoint
// Inject websocket url to dev backend
window.WS_URL = 'ws://' + location.hostname + ':4040';
window.WS_PROTO = (location.protocol === 'https:' ? 'wss' : 'ws');
window.WS_URL = window.WS_PROTO + '://' + location.hostname + ':4040';
require('./main');

View File

@@ -3,8 +3,8 @@ const reqwest = require('reqwest');
const AppActions = require('../actions/app-actions');
const WS_URL = window.WS_URL || 'ws://' + location.host + location.pathname.replace(/\/$/, '');
const WS_PROTO = window.WS_PROTO || (location.protocol === 'https:' ? 'wss' : 'ws');
const WS_URL = window.WS_URL || WS_PROTO + '://' + location.host + location.pathname.replace(/\/$/, '');
const apiTimerInterval = 10000;
const reconnectTimerInterval = 5000;