How do you connect to vpn using node.js

montage9 picture montage9 · Aug 13, 2013 · Viewed 9.3k times · Source

I am a newbie to node.js and looking for some example code or pointers on connecting through PPTP to a private virtual ip address using VPN connection. I have a node.js server running on aws that currently uses udp to connect to a public ip address. However, this needs to be changed to tunnel into the private vpn.

I have the uid,pwd and apn for the vpn. What are the steps I would need to take to tunnel in, and then connect to the private ip?

Appreciate any tips you might have.

Thanks M

Answer

zayquan picture zayquan · Apr 4, 2015

Does the node process need to be responsible for establinshing the VPN tunnel, or does it just need to use the correct network interface so that it's traffic is being tunnelled through the VPN?

If the latter then you just need to bind to the correct network address that corresponds to the VPN tunnel, as described here : Bind expressjs to a specific IP address