From c57b8f6a6d4be6c81fdf506aaa9df64cb4033a7a Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 5 Oct 2016 23:10:16 -0600 Subject: [PATCH] also pass hello packet --- bin/stunnel.js | 4 +++- wsclient.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/stunnel.js b/bin/stunnel.js index 832b20e..396a961 100755 --- a/bin/stunnel.js +++ b/bin/stunnel.js @@ -113,9 +113,11 @@ program.net = { myDuplex.localFamily = socket.localFamily; myDuplex.localAddress = socket.localAddress; myDuplex.localPort = socket.localPort; + httpsServer.emit('connection', myDuplex); */ - // info = { servername, port, host, remoteAddress: { family, address, port } } + // data is the hello packet / first chunk + // info = { data, servername, port, host, remoteAddress: { family, address, port } } var net = require('net'); // socket = { write, push, end, events: [ 'readable', 'data', 'error', 'end' ] }; var socket = net.createConnection({ port: info.port, host: info.host }, cb); diff --git a/wsclient.js b/wsclient.js index d02a550..2e4051f 100644 --- a/wsclient.js +++ b/wsclient.js @@ -87,6 +87,7 @@ function run(copts) { servername: servername , port: port , host: '127.0.0.1' + , data: opts.data , remoteAddress: { family: opts.family , address: opts.address