From d9486b82976e1bb8319eaffd7319bb778a1fa888 Mon Sep 17 00:00:00 2001 From: tigerbot Date: Mon, 29 May 2017 12:50:29 -0600 Subject: [PATCH] fixed a few problems with our connections --- lib/proxy-conn.js | 1 + lib/servers.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/proxy-conn.js b/lib/proxy-conn.js index b9a704c..625a864 100644 --- a/lib/proxy-conn.js +++ b/lib/proxy-conn.js @@ -34,6 +34,7 @@ module.exports.sendBadGateway = sendBadGateway; module.exports.create = function (deps, config) { return function proxy(conn, newConnOpts, firstChunk, decrypt) { var connected = false; + newConnOpts.allowHalfOpen = true; var newConn = deps.net.createConnection(newConnOpts, function () { connected = true; diff --git a/lib/servers.js b/lib/servers.js index e7f4d1f..c4000a5 100644 --- a/lib/servers.js +++ b/lib/servers.js @@ -29,7 +29,7 @@ module.exports.addTcpListener = function (port, handler) { var enableDestroy = require('server-destroy'); var net = require('net'); var resolved; - var server = net.createServer(); + var server = net.createServer({allowHalfOpen: true}); stat = serversMap[port] = { server: server diff --git a/package.json b/package.json index 4a232f5..79dfe63 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "serve-static": "^1.10.0", "server-destroy": "^1.0.1", "sni": "^1.0.0", - "socket-pair": "^1.0.0", + "socket-pair": "^1.0.1", "stream-pair": "^1.0.3", "stunnel": "git+https://git.daplie.com/Daplie/node-tunnel-client.git#v1", "tunnel-packer": "^1.3.0"