VPN service with Nice Python integration

Can anyone recommend a decent VPN provider that has a python module/wrapper that allows for automated connecting/disconnecting?

Paid providers are welcome and preferred.

Most vpns are openvpn on based. So connecting/disconnecting is as simple as shelling out to start/stop the service (on Linux with systemd that’s just systemctl start/stop openvpn)

Is this for Windows… Because that would complicate things a lot. Also do you need port forwarding?

The VPN provider isn’t really what’s doing the connecting/disconnecting, it’s your local computer.

If you’re on desktop Linux, you might use for example Python-NetworkManager to communicate with Network Manager. Failing that, you can always just call a shell command.

If you’re on Mac, it’s going to be totally different. Windows totally different. Linux server, totally different. With Android, I imagine you use a Java API.

It’s not a matter of the provider, it’s what your client does.

openvpn can run as a service on any Linux distro so it really just depends on the function of why you’re connecting and disconnecting. You can write a script to make the vpn up or down built into the openvpn command as well. No reason to reinvent the wheel using python.

Assume your trying to establish the connection then drop it when complete.

What operating system are you on?

You’re probably going to have to do a call using something like execute to make a call to run a application on your computer.

But there are some other things your going to want to watch as you use the connection. For example if the connection goes down you won’t know it and you will start using your normal internet. So you want to monitor the connection the entire time. With Linux you can just monitor the presence of the tun exists. Not sure what you would monitor with windows.

Hmm, good point. Definitely wouldn’t be on Windows. Likely going to be run on Linux or Mac which should make things easier.

Thanks for the help. I could run this on a Linux machine, but would prefer to keep it on a Mac if possible due to resources.

Thanks for the insight. I would definitely run this on a Mac or Linux machine.

Gotcha. I’m sure there’s an Objective C API in Mac for connecting to VPN’s (just from a quick search, this comes up).

You don’t usually need a desktop app to connect to anyone’s VPN, but services like VyprVPN offer one because it’s a good UX. The app will test which VPN data center is pinging the best and use it, which isn’t something you’d get just using the Mac native VPN client.

If you wanted to wrap that, you could probably do it with Automator.