I want to create a VPN connect with a Python script for just a few Python Sockets. I need to tunnel just the traffic of that Script through a VPN like a Proxy does it.
Is there an API?
I cannot change the setting of the machine because the user may not want to create a VPN which tunnels his traffic.
Requirements. OpenVPN needs to be installed. The script should run on any Linux distribution with the Python Requests module installed. The user running the script must be able to run sudo commands in order to start openvpn .
##Quickstart Just type python vpngate.py in your terminal screen and select country and server you want to connect. The connection can be terminated by pressing Ctrl + C . If you want connect vpn server using default options, just type python vpngate.py -y .
What you want is not a VPN, is an IP port forward, a proxy:
http://voorloopnul.com/blog/a-python-proxy-in-less-than-100-lines-of-code/
If need a secure connection between 2 hosts you could use a SSH port forward:
http://www.debianadmin.com/howto-use-ssh-local-and-remote-port-forwarding.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With