Zonda Python Proxy
Install
pip install zoxy
Quick start for cli
Default server path: 127.0.0.1:8080
$ ./zoxy
Customize url and port
Example: 0.0.0.0:9999
$ ./zoxy -u 0.0.0.0 -p 9999
Allowed access
Example:
- 127.0.0.1, mask: 255.255.255.255, port 8080
- 127.0.0.0, mask: 255.255.255.0, port: all
$ ./zoxy --allowed_access 127.0.1.1 8080 --allowed_access 127.0.0.0/24 *
Blocked access
Example:
- 127.0.0.1, mask: 255.255.255.255, port: 8080
- 127.0.0.0, mask: 255.255.255.0, port: all
$ ./zoxy --blocked_access 127.0.1.1 8080 --blocked_access 127.0.0.0/24 *
Note: Blocked access setting has higher priority than allowed access.
Forwarding
Example:
- 192.168.1.0, mask: 255.255.255.0, port: 1234 to 127.0.0.1, port: 8000
- 0.0.0.0, mask: 0.0.0.0, port: all to 127.0.0.2, port: all
$ ./zoxy --forwarding 192.168.1.0/24 1234 127.0.0.1 8000 --forwarding 0.0.0.0/0 * 127.0.0.2 *
Quick start for program
import zoxy.server
config = {
"url": "0.0.0.0",
"port": 9999,
"allowed_accesses": [
["127.0.1.1", "8080"],
["127.0.2.0/24", "1234"],
["127.0.0.0/24", "*"],
],
"blocked_accesses": [
["192.0.1.1", "8080"],
["192.0.2.0/24", "1234"],
["192.0.0.0/24", "*"],
],
"forwarding": [
["196.168.2.1", "1234", "127.0.2.1", "8000"],
["196.168.1.0/24", "1234", "127.0.0.1", "8000"],
["0.0.0.0/0", "*", "127.0.0.2", "*"],
],
"load_balancing": {
"frontend": ["127.0.0.1/32", "8080"],
"backend": [
["127.0.0.1", "9090", "80"],
["127.0.0.1", "*", "20"],
],
},
}
zoxy.server.ProxyServer(**config).listen()
Get/Set accesses
Allowed accesses
# Get
proxy_server.allowed_accesses
'''
[
["127.0.1.1/32", "8080"],
["127.0.2.0/24", "1234"],
["127.0.0.0/24", "*"],
]
'''
# Set
proxy_server.allowed_accesses = [
["111.0.1.1", "8080"],
["111.0.2.0/24", "1234"],
["111.0.0.0/24", "*"],
]
Blocked accesses
# Get
proxy_server.blocked_accesses
'''
[
["192.0.1.1/32", "8080"],
["192.0.2.0/24", "1234"],
["192.0.0.0/24", "*"],
]
'''
# Set
proxy_server.blocked_accesses = [
["111.0.1.1", "8080"],
["111.0.2.0/24", "1234"],
["111.0.0.0/24", "*"],
]
Get/Set forwarding
# Get
proxy_server.forwarding
'''
[
["196.168.2.1/32", "1234", "127.0.2.1", "8000"],
["196.168.1.0/24", "1234", "127.0.0.1", "8000"],
["0.0.0.0/0", "*", "127.0.0.2", "*"]
]
'''
# Set
proxy_server.forwarding = [
["176.168.2.1", "1234", "127.0.2.1", "8000"],
["176.168.1.0/24", "1234", "127.0.0.1", "8000"],
["176.0.0.0/8", "*", "127.0.0.2", "*"]
]
Get/Set Load balancing
# Get
proxy_server.load_balancing
'''
{
"frontend": ["127.0.0.1/32", "8080"],
"backend": [
["127.0.0.1", "9090", "80"],
["127.0.0.1", "*", "20"],
],
}
'''
# Set
proxy_server.load_balancing = {
"frontend": ["168.0.0.1/32", "8080"],
"backend": [
["111.0.0.1", "9090", "80"],
["111.0.0.1", "*", "20"],
],
}
Developer
Test
python -m unittest
Type checking
mypy zoxy
Metadata
Release files for zoxy 0.0.5
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 |
|---|---|---|---|---|
| zoxy-0.0.5.tar.gz | 8.6 kB | Without provenance | Details for zoxy-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zoxy-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for zoxy-0.0.5-py3-none-any.whl |
Total release size: 17.8 kB
Release files / zoxy-0.0.5.tar.gz
| Download URL | zoxy-0.0.5.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d0ddb85a694eb539bb6942f31e7837efaa81efdeef14ab7c14dc0d40a5bea3b
|
|
BLAKE2b-256 checksum How to use checksums |
849a9efd72ba70dba25875b8c17830a2793370f6a1da6b3abd0ac9a1f25a1b75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Release files / zoxy-0.0.5-py3-none-any.whl
| Download URL | zoxy-0.0.5-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a346be67d796d6b2760a5a2fb53f46d4b06fb42c08faa8c86c15f04191fc2797
|
|
BLAKE2b-256 checksum How to use checksums |
92304e1fa04aafc08e02629c29dd469339c8b3d4aaf72de6401f5f5937c45c8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Security for zoxy 0.0.5
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.