MrHex MrHex - 5 months ago 57
Python Question

How to connect to a VPN/Proxy server via Python?

Okay so i know that you can route web-requests through a proxy in Python, is there any way to route ALL traffic from your system through a server. Much like a VPN client such as Hotspot Shield or CyberGhost, but a custom-build client using the Python language?

Any links/help is greatly appreciated.



The short answer is no.

The long answer is: network routing is managed by OS and could be managed by other utilities, like iptables. Adding such capabilities to standard libraries is out of the scope of programming language. So, what you are probably looking for is a binding of a VPN library (e.g. libpptp) or making syscalls in Cython, which is not much different than writing in C.