title: Node.js - Programmatically Connect to a VPN or route HTTP Requests via VPN
body: <p>This is probably a bit of a long shot. But in Node.js I want to make an HTTP request (using, for instance, the <a href="https://www.npmjs.com/package/request" rel="noreferrer">request</a> package on npm) via a VPN server. I already have a VPN server set-up (using <a href="https://www.hidemyass.com" rel="noreferrer">HideMyAss</a>) 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.</p>
  
  <p>This can be done using proxies, for instance:</p>
  
  <pre><code>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) {
  
  });
  </code></pre>
  
  <p>...but I want to do something similar with VPNs. Is this even possible? Thanks!</p>