closeTunnel always returns false?
peterp85 opened this issue · comments
Sample code below is very similar to example listed on apify blog.
const { createTunnel, closeTunnel } = require('proxy-chain');
(async() => {
const tunnelInfo = await createTunnel(
'http://aaa:bbbb@127.0.0.1:8888',
'127.0.0.2:8889'
);
closeTunnel(tunnelInfo).then(res=>console.log(res));
})();
No matter what I use as proxyUrl and targetHost result is same - closeTunnel return false but lsof -i -P -n
show that port is still listening and I can use it as proxy. Am I missing something?
Tested on nodejs version 10.20.1 and 12.19.0, proxy-chain version 0.4.5
Hello!
I changed a part of code and sended a Pull Request #101, if you wanna fix it in your side until the release, please open the file node_modules\proxy-chain\build\tcp_tunnel_tools.js
and do this:
- On line 123, please replace
resolve()
toresolve(true)
, and do the same in the line 127; - On line 131, please replace
runningServers[port].close
torunningServers[port].server.close
.
If you have any questions or need more help, please let me know.
Kind regards,
André
PR merged!