@applitools/eg-socks5-proxy-server
Advanced tools
Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "@applitools/eg-socks5-proxy-server", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -18,2 +18,4 @@ const net = require('net') | ||
let handshakeTimeout; | ||
const destination = net.createConnection(port, address, () => { | ||
@@ -29,5 +31,7 @@ // prepare a success response | ||
const handshakeTimeout = setTimeout(()=> { | ||
handshakeTimeout = setTimeout(()=> { | ||
isTimeoutCalled = true | ||
destination.destroy() | ||
proxyServer.onHandshakeTimeout() | ||
isTimeoutCalled = true | ||
}, 10000) | ||
@@ -44,5 +48,2 @@ | ||
} | ||
else{ | ||
destination.destroy() | ||
} | ||
}) | ||
@@ -81,2 +82,4 @@ }) | ||
destination.on('error', (err) => { | ||
handshakeTimeout && clearTimeout(handshakeTimeout) | ||
// notify of connection error | ||
@@ -83,0 +86,0 @@ err.addr = args.dst.addr |
@@ -271,6 +271,9 @@ const { | ||
} | ||
let retry = 0 | ||
proxyServer.onHandshakeTimeout = () => { | ||
self.server.emit(EVENTS.REMOTE_PROXY_HANDSHAKE_TIMEOUT, {originInfo, destinationInfo, proxyServer}) | ||
createExecuterAndRegisterToEvents() | ||
retry++ | ||
if (retry <= 3) createExecuterAndRegisterToEvents() | ||
else end(RFC_1928_REPLIES.NETWORK_UNREACHABLE, args) | ||
} | ||
@@ -277,0 +280,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22395
557
54