Skip to main content

Python bindings for shadowsocks sysproxy utility.

Project description

sysproxy

Python bindings for shadowsocks sysproxy utility. This is a Windows-only package.

API

>>> import sysproxy
>>> sysproxy.off() # Turn proxy settings off
True # Returns True if success. False otherwise
>>> sysproxy.pac('pac_url') # Turn proxy settings on with PAC
True # Returns True if success. False otherwise
>>> sysproxy.set('127.0.0.1:10809', '127.*;10.*;172.16.*') # Turn proxy settings on with server and bypass
True # Returns True if success. False otherwise
>>> sysproxy.daemon_off() # Turn proxy daemon off
True # Returns True if success. False otherwise
>>> sysproxy.daemon_on_() # Turn proxy daemon on. You should launch this function in a Python thread.

Install

pip install sysproxy

sysproxy daemon

When sysproxy daemon turned on, it executes a window-less WINAPI event loop that captures WM_QUERYENDSESSION message, which is sent when Windows is about to shutdown. When the message arrives, the daemon calls off(), which turns proxy settings off.

As mentioned above, sysproxy.daemon_on_() will block current Python execution, so you should launch it in a Python thread.

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

sysproxy-0.1.0.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distributions

sysproxy-0.1.0-cp311-cp311-win_amd64.whl (54.2 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

sysproxy-0.1.0-cp310-cp310-win_amd64.whl (54.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

sysproxy-0.1.0-cp39-cp39-win_amd64.whl (53.6 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

sysproxy-0.1.0-cp38-cp38-win_amd64.whl (54.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

sysproxy-0.1.0-cp37-cp37m-win_amd64.whl (54.2 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

sysproxy-0.1.0-cp36-cp36m-win_amd64.whl (54.4 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

Supported by

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