simplify server websocket configuration

This commit is contained in:
ansuz 2019-12-23 17:01:00 -05:00
parent 31ec784de6
commit 2dfbb522b0
3 changed files with 0 additions and 14 deletions

View File

@ -17,9 +17,6 @@ sedeasy() {
}
# Configure
[ -n "$USE_SSL" ] && echo "Using secure websockets: $USE_SSL" \
&& sedeasy "useSecureWebsockets: [^,]*," "useSecureWebsockets: ${USE_SSL}," cfg/config.js
[ -n "$STORAGE" ] && echo "Using storage adapter: $STORAGE" \
&& sedeasy "storage: [^,]*," "storage: ${STORAGE}," cfg/config.js

View File

@ -13,9 +13,6 @@ var nThen = require("nthen");
var config = require("./lib/load-config");
var websocketPort = config.websocketPort || config.httpPort;
var useSecureWebsockets = config.useSecureWebsockets || false;
// This is stuff which will become available to replify
const debuggableStore = new WeakMap();
const debuggable = function (name, x) {
@ -211,9 +208,6 @@ app.get('/api/config', function(req, res){
removeDonateButton: (config.removeDonateButton === true),
allowSubscriptions: (config.allowSubscriptions === true),
websocketPath: config.useExternalWebsocket ? undefined : config.websocketPath,
// FIXME don't send websocketURL if websocketPath is provided. deprecated.
websocketURL:'ws' + ((useSecureWebsockets) ? 's' : '') + '://' + host + ':' +
websocketPort + '/cryptpad_websocket',
httpUnsafeOrigin: config.httpUnsafeOrigin.replace(/^\s*/, ''),
adminEmail: config.adminEmail,
adminKeys: admins,
@ -327,10 +321,6 @@ var nt = nThen(function (w) {
historyKeeper = HK.create(hkConfig);
}).nThen(function () {
if (config.useExternalWebsocket) { return; }
if (websocketPort !== config.httpPort) {
log.debug("setting up a new websocket server");
wsConfig = { port: websocketPort};
}
var wsSrv = new WebSocketServer(wsConfig);
NetfluxSrv.run(wsSrv, config, historyKeeper);
});

View File

@ -4,7 +4,6 @@ define([
var Config = {};
Config.getWebsocketURL = function (origin) {
if (!ApiConfig.websocketPath) { return ApiConfig.websocketURL; }
var path = ApiConfig.websocketPath;
if (/^ws{1,2}:\/\//.test(path)) { return path; }