Reputation: 4342
I want to create a VPN connection 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 any API?
I cannot change the setting of the machine because the user may not want to create a VPN which tunnels his traffic.
Upvotes: 7
Views: 32600
Reputation: 1811
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
Upvotes: 3