Skip to main content

说明

  • 功能

    1. 获取登录的客户端的信息.
        commaon_name    # 客户端的登录名
        remote_ip       # 客户端的IP地址
        virtual_ip      # 分配给客户端的虚拟IP地址
        send_bytes      # 发送字节数
        recv_bytes      # 接收字节数
        login_time      # 登录时间
    
    2. kill客户端
        依赖客户端的common_name
    
  • openvpn启动management interface

    /usr/sbin/openvpn --cd /etc/openvpn/ --config server.conf --management 10.0.0.1 1195
    
  • 使用示例

    1. 安装
    pip install pyopenvpn
    
    2. 使用
    import pyopenvpn
    
    vpn = pyopenvpn.Openvpn('10.0.0.1', 1195)
    
    方法:
    vpn.version()           # 获取vpn的版本
    vpn.clients()           # 获取所有在线客户端
    vpn.pid()               # 获取VPN的进程ID
    vpn.kill(common_name)   # kill掉指定的客户端
    vpn.close()             # 关闭socket
    

Metadata

Release files for pyopenvpn 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyopenvpn 0.0.3
File Size Uploaded
pyopenvpn-0.0.3.tar.gz 2.9 kB Details

Release files / pyopenvpn-0.0.3.tar.gz

Download URL pyopenvpn-0.0.3.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5af15d7fa5533d5c18c758f3147db72a97ffd42234b5fa7907353c3a737425bf
BLAKE2b-256 checksum
How to use checksums
6846808867131ced9b7d5ab6cb3671b29384a9ee9c43893145dc84ed813575c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page