Fix for web relay using ports.

This commit is contained in:
Ylian Saint-Hilaire 2022-07-11 23:26:54 -07:00
parent e1a6091f94
commit bcc2a8607e
2 changed files with 2 additions and 2 deletions

View File

@ -1654,7 +1654,7 @@ function CreateMeshCentralServer(config, args) {
if (obj.common.validateStrArray(obj.args.relaydns, 1) == false) { delete obj.args.relaydns; }
// Start the HTTP relay web server if needed
if ((obj.args.relaydns != null) && (typeof obj.args.relayport == 'number') && (obj.args.relayport != 0)) {
if ((obj.args.relaydns == null) && (typeof obj.args.relayport == 'number') && (obj.args.relayport != 0)) {
obj.webrelayserver = require('./webrelayserver.js').CreateWebRelayServer(obj, obj.db, obj.args, obj.certificates, function () { });
}

View File

@ -63,7 +63,7 @@ module.exports.CreateWebRelayServer = function (parent, db, args, certificates,
// Setup a keygrip instance with higher default security, default hash is SHA1, we want to bump that up with SHA384
// If multiple instances of this server are behind a load-balancer, this secret must be the same for all instances
// If args.sessionkey is a string, use it as a single key, but args.sessionkey can also be used as an array of keys.
const keygrip = require('keygrip')((typeof obj.args.sessionkey == 'string') ? [obj.args.sessionkey] : obj.args.sessionkey, 'sha384', 'base64');
const keygrip = require('keygrip')((typeof args.sessionkey == 'string') ? [args.sessionkey] : args.sessionkey, 'sha384', 'base64');
// Setup cookie session
const sessionOptions = {