Listen 'address' for WebSockets

This commit is contained in:
Bryan Ashby 2019-04-09 20:25:37 -06:00
parent 37ea1e3a30
commit 50426d0e60
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
1 changed files with 3 additions and 2 deletions

View File

@ -200,7 +200,8 @@ exports.getModule = class WebSocketLoginServer extends LoginServerModule {
}
const serverName = `${ModuleInfo.name} (${serverType})`;
const confPort = _.get(Config(), [ 'loginServers', 'webSocket', 'secure' === serverType ? 'wss' : 'ws', 'port' ] );
const conf = _.get(Config(), [ 'loginServers', 'webSocket', 'secure' === serverType ? 'wss' : 'ws' ] );
const confPort = conf.port;
const port = parseInt(confPort);
if(isNaN(port)) {
@ -208,7 +209,7 @@ exports.getModule = class WebSocketLoginServer extends LoginServerModule {
return nextServerType(Errors.Invalid(`Invalid port: ${confPort}`));
}
server.httpServer.listen(port, err => {
server.httpServer.listen(port, conf.address, err => {
if(err) {
return nextServerType(err);
}