more flexible websocket configuration (WIP)

This commit is contained in:
ansuz
2016-10-03 19:19:38 +02:00
parent 9fa7da60b9
commit 3dfa19b786
3 changed files with 18 additions and 4 deletions

View File

@@ -56,10 +56,9 @@ app.get('/api/config', function(req, res){
var host = req.headers.host.replace(/\:[0-9]+/, '');
res.setHeader('Content-Type', 'text/javascript');
res.send('define(' + JSON.stringify({
websocketPath: config.websocketPath,
websocketURL:'ws' + ((httpsOpts) ? 's' : '') + '://' + host + ':' +
config.websocketPort + '/cryptpad_websocket',
webrtcURL:'ws' + ((httpsOpts) ? 's' : '') + '://' + host + ':' +
config.websocketPort + '/cryptpad_webrtc',
}) + ');');
});