Uniproxy
Cross-platform python library to set system-wide proxy and proxy bypass domains.
Features
- Cross Platform: Uniproxy is cross-platform and can be used on Windows, macOS and Linux.
- System Wide Proxy: Uniproxy can be used to set system-wide proxy for the host.
- Bypassing Domains: Uniproxy can be used to set bypass domains which don't go through the system-wide proxy.
- Environment Variables: Uniproxy can also set environment variables for the proxy.
Installation
$ pip3 install uniproxy
Getting Started
Install the package as mentioned above and import it.
Proxy setup
import uniproxy
prox = uniproxy.Uniproxy(ip="127.0.0.1", port=8081) ## Create a uniproxy instance
prox.set_proxy() ## Set system-wide proxy without changing the current proxy enabled state for the OS
prox.set_proxy_enabled(True) ## Enable system-wide proxy
This will first edit the OS Settings to set the proxy and then enable the proxy.
import uniproxy
prox = uniproxy.Uniproxy(ip="127.0.0.1", port=8081) ## Create a uniproxy instance
prox.join() ## Change
As an alternative, you can also use the above method to set the proxy and enable it directly.
Bypass Domains
import uniproxy
prox = uniproxy.Uniproxy(ip="127.0.0.1", port=8081) ## Create a uniproxy instance
prox.set_bypass_domains(["www.google.com", "www.facebook.com"]) ## Set bypass domains
This will set the bypass domains for the proxy. The domains mentioned in the list will not pass through the proxy. Environment variables no_proxy and NO_PROXY will also be set.
Turn off Proxy
import uniproxy
prox = uniproxy.Uniproxy(ip="127.0.0.1", port=8081) ## Create a uniproxy instance
prox.set_proxy_enabled(False) ## Disable system-wide proxy
This will disable the system-wide proxy.
Delete Proxy
import uniproxy
prox = uniproxy.Uniproxy(ip="127.0.0.1", port=8081) ## Create a uniproxy instance
prox.delete_proxy() ## Delete the proxy settings
This will delete the proxy settings from the system and set them to OS defaults.
Get Proxy Details
import uniproxy
prox = uniproxy.Uniproxy(ip="127.0.0.1", port=8081) ## Create a uniproxy instance
prox.join()
print(prox.get_proxy()) ## Get the proxy details
This will output the following (on Linux, KDE)
{
"is_enable": True,
"http": {"ip_address": "127.0.0.1", "port": "8081"},
"https": {"ip_address": "127.0.0.1", "port": "8081"},
"ftp": {"ip_address": "127.0.0.1", "port": "8081"},
}
Get Bypass Domains
import uniproxy
prox = uniproxy.Uniproxy(ip="127.0.0.1", port=8081) ## Create a uniproxy instance
prox.set_bypass_domains(["www.google.com", "www.facebook.com"]) ## Set bypass domains
print(prox.get_bypass_domains()) ## Get bypass domains
This will output the following
['www.google.com', 'www.facebook.com']
MacOS Specific Functionality
Get default network service
import uniproxy
prox = uniproxy.Uniproxy(ip="127.0.0.1", port=8081) ## Create a uniproxy instance
print(prox.proxy.get_default_network_service()) ## Get the default network service
This will output the following (depends on the system and current network configuration):
Wi-Fi
Default network service is determined by parsing the output of route -n get default command. If it fails for some reason the default network service is found out by parsing the output of networksetup -listallnetworkservices command and returning the first network service which is not disabled.
Known Issues
- Uniproxy only works on SystemD based Linux systems.
- Uniproxy only supports KDE and GNOME desktop environments on Linux.
Credits
- hash3liZer/Proxverter: for providing the initial base for the project.
- zzzgydi/sysproxy-rs: for providing help with the macOS implementation.
- Proxy Server page on Arch wiki: for providing information on environment variables on linux.
Metadata
Release files for Uniproxy 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| uniproxy-1.5.0.tar.gz | 20.4 kB | Without provenance | Details for uniproxy-1.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| uniproxy-1.5.0-py3-none-any.whl | Python 3 | none | any | Details for uniproxy-1.5.0-py3-none-any.whl |
Total release size: 41.6 kB
Release files / uniproxy-1.5.0.tar.gz
| Download URL | uniproxy-1.5.0.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97bd6f6255025ec9dc5e2110fd8d5e81d75d850d1be74d03a0bb534aac394159
|
|
BLAKE2b-256 checksum How to use checksums |
b1847338c30cc563c07cba21175d2a0c05ae5ad03cd591a5fa68cdd9a0c9f1c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.13.5 Linux/6.15.4-arch2-1
|
Release files / uniproxy-1.5.0-py3-none-any.whl
| Download URL | uniproxy-1.5.0-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a139dee4ee21c7936f4fbf4d6851c931ff2ff7d245306ab7614732b202db5bc9
|
|
BLAKE2b-256 checksum How to use checksums |
65e9f95deea47b763b37c5a76cca2a6ceda7fa9e4ebb98eaa7e8acaa9eeb20ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.13.5 Linux/6.15.4-arch2-1
|
Security for Uniproxy 1.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.