Skip to main content

Just a Python module suitable to use multiple OpenVPN connections at same time

Project description

How to use:

from vpnocchio import VPN, init_logging
from threading import Thread

init_logging()

# set your dir with ovpn files, default is:
VPN.conf_dir = '/etc/openvpn
# set minimum seconds must elapse between reconnects
VPN.min_time_before_reconnect = 30

credentials = [('usr1', 'pwd1', 'Germany'),
               ('usr1', 'pwd2', 'Spain')]

def do_something(*args):
    vpn = VPN(*args)
    for one in range(2):
        # it has requests inside
        response = vpn.get('http://ip.barjomet.com')
        vpn.log.info('Hooray, here is desired data: %s',  response.text)
        vpn.new_ip()
    vpn.disconnect()

for username, password, match_config_name in credentials:
    Thread(target=do_something,
           args=(username,
                 password,
                 match_config_name)).start()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

VPNocchio-0.0.24.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file VPNocchio-0.0.24.tar.gz.

File metadata

  • Download URL: VPNocchio-0.0.24.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for VPNocchio-0.0.24.tar.gz
Algorithm Hash digest
SHA256 2c7e8897ad6b4cde943b4019ae8480cdfd4960fd6dfcf3844e3ac43eacbc9a00
MD5 6f88d0de42346495ee0d6061634b4d2d
BLAKE2b-256 7a2b4ea8e2ecd65061995d9adb8d1ba859162cc136072e917b8344d1dc366dc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page