From b342cfd159db8ea55e9830dcfd4f82ca9aa50a56 Mon Sep 17 00:00:00 2001 From: Zaid Abdulla Date: Wed, 22 Feb 2017 04:22:26 -0800 Subject: [PATCH] Fix linking sessions to sockets when using SSL --- lib/server.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/server.coffee b/lib/server.coffee index 80f4202..f71da63 100644 --- a/lib/server.coffee +++ b/lib/server.coffee @@ -82,11 +82,10 @@ if useHttps .match(/\-+BEGIN CERTIFICATE\-+[0-9a-zA-Z\+\-\/\=\s]+?\-+END CERTIFICATE\-+/g) server = require('https').createServer(options, listener) + server.on('secureConnection', onConnection) if onConnection? else server = require('http').createServer(listener) - -if onConnection? - server.on('connection', onConnection) + server.on('connection', onConnection) if onConnection? db.connect((err) -> throw err if err