From 643b5a62ea54dd94fbd24404e0fba90052fa6de9 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 31 May 2018 06:18:02 +0000 Subject: [PATCH] minor optimization --- bin/telebitd.js | 3 ++- lib/unwrap-tls.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/telebitd.js b/bin/telebitd.js index 248e770..804920a 100755 --- a/bin/telebitd.js +++ b/bin/telebitd.js @@ -154,7 +154,8 @@ function applyConfig(config) { state.tcp[port].listen(port, function () { console.log('listening plain TCP on ' + port); }); - state.tcp[port].on('connection', function (conn) { netConnHandlers.tcp(conn, port); }); + //state.tcp[port].on('connection', function (conn) { netConnHandlers.tcp(conn, port); }); + state.tcp[port].on('connection', netConnHandlers.tcp); }); //}); } diff --git a/lib/unwrap-tls.js b/lib/unwrap-tls.js index 3a18b60..ba1b2a8 100644 --- a/lib/unwrap-tls.js +++ b/lib/unwrap-tls.js @@ -54,7 +54,7 @@ module.exports.createTcpConnectionHandler = function (copts) { var Devices = copts.Devices; return function onTcpConnection(conn, serviceport) { - console.log('[new conn] from port', serviceport); + serviceport = serviceport || conn.localPort; // this works when I put it here, but I don't know if it's tls yet here // httpsServer.emit('connection', socket); //tls3000.emit('connection', socket);