问题
I'm trying to use NordVPN like a standard web proxy by adding the proxy to the request options like so:
const request = require('request-promise');
const options = {
url: 'https://icanhazip.com',
proxy: 'tcp://email@email.com:pass@us349.nordvpn.com',
}
const res = await request.get(options); // returns the NordVPN server ip address
This works, however, NordVPN allows a maximum of 6 connections and when the proxy url is changed, the previous connection stays open.
I see that I can run sudo lsof -iTCP -sTCP:LISTEN -n -P
in order to get the process ID for the node process with the connection, however, when running pm2
, attempting to kill the node TCP connection does not work - it simply restarts.
Is there a way to destroy the connection without killing pm2
?
来源:https://stackoverflow.com/questions/58404966/node-js-pm2-cant-kill-tcp-connection