Skip to content

Commit

Permalink
Added info statements to clarify if the socket created was secure or not
Browse files Browse the repository at this point in the history
  • Loading branch information
MKHenson committed Jun 23, 2016
1 parent 798e009 commit 1fcaf80
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/controllers/comms-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export class CommsController extends events.EventEmitter
// Create the web socket server
if (cfg.ssl)
{
winston.info("Creating secure socket connection", { process: process.pid });
var httpsServer: https.Server = null;
var caChain = [fs.readFileSync(cfg.sslIntermediate), fs.readFileSync(cfg.sslRoot)];
var privkey = cfg.sslKey ? fs.readFileSync(cfg.sslKey) : null;
Expand All @@ -159,7 +160,11 @@ export class CommsController extends events.EventEmitter
this._server = new ws.Server({ server: httpsServer });
}
else
this._server = new ws.Server({ port: cfg.websocket.port });
{
winston.info("Creating regular socket connection", { process: process.pid });
this._server = new ws.Server({ port: cfg.websocket.port });
}


winston.info("Websockets attempting to listen on HTTP port " + cfg.websocket.port, { process: process.pid });

Expand Down Expand Up @@ -189,7 +194,7 @@ export class CommsController extends events.EventEmitter

if (!clientApproved)
{
winston.error(`A connection was made by ${headers.host || headers.origin} but it is not on the approved domain list. Make sure the host is on the approvedSocketDomains parameter in the config file.`);
winston.error(`A connection was made by ${headers.origin} but it is not on the approved domain list. Make sure the host is on the approvedSocketDomains parameter in the config file.`);
ws.terminate();
ws.close();
}
Expand Down

0 comments on commit 1fcaf80

Please sign in to comment.