diff --git a/lib/server.js b/lib/server.js index bcac647..eb94884 100644 --- a/lib/server.js +++ b/lib/server.js @@ -231,7 +231,11 @@ function proxySocket(socket, req) { } else if (dstSock.writable) dstSock.end(); }) - .connect(req.dstPort, dstIP); + .connect({ + port: req.dstPort, + host: dstIP, + localAddress: socket.address().address + }); socket.dstSock = dstSock; }); } @@ -257,4 +261,4 @@ function handleProxyError(socket, err) { } socket.end(errbuf); } -} \ No newline at end of file +}