This is probably a bit of a long shot. But in Node.js I want to make an HTTP request (using, for instance, the request package on npm) via a VPN server. I already have a VPN server set-up (using HideMyAss) and I can connect to it at the Operating System level, by configuring it in my OSs networking settings section. But I want to connect to it programmatically using a Nodejs program, and have any HTTP requests made using that program routed through that VPN.
This can be done using proxies, for instance:
var request = require('request');
var url = 'https://www.google.com';
var proxy = 'http://username:password@usa.proxyservice.com:1234';
request.get({ url: url, proxy: proxy }, function(err, res, body) {
});
...but I want to do something similar with VPNs. Is this even possible? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…