eggress Python bindings
Python bindings for the eggress proxy framework, powered by PyO3 and the Rust embed API.
Installation (local development)
pip install maturin
cd crates/eggress-python
rm -f ../../target/wheels/eggress-*.whl # stale wheels break the install glob below
maturin build --target x86_64-apple-darwin # adjust target for your platform
pip install --force-reinstall target/wheels/eggress-*.whl
Prebuilt wheels
Prebuilt wheels are published to PyPI for:
- Linux x86_64 and aarch64 (manylinux)
- macOS x86_64 and arm64
- Windows x86_64
The wheel uses the Python stable ABI (abi3-py39), so one wheel per platform supports all declared Python versions (3.9–3.13). Other platforms can install from the source distribution (requires Rust toolchain).
Supported Python versions: 3.9, 3.10, 3.11, 3.12, 3.13.
Quick start
from eggress import EggressService
with EggressService.from_toml("""
version = 1
[[listeners]]
name = "socks"
bind = "127.0.0.1:0"
protocols = ["socks5"]
""").start() as handle:
addr = handle.bound_addresses["socks"]
print(f"SOCKS5 listening on {addr}")
print(handle.metrics_text())
Async usage
import asyncio
from eggress import EggressService
async def main():
async with await EggressService.from_toml(TOML).astart() as handle:
print("Listening on", await handle.bound_addresses)
asyncio.run(main())
API
EggressConfig.from_toml(toml)/EggressConfig.from_file(path)— parse configEggressService(config)/EggressService.from_toml(toml)— create serviceservice.start()— start proxy, returnsEggressHandlehandle.bound_addresses— dict of listener name -> addresshandle.status()— generation, readiness, uptime, connectionshandle.metrics_text()— Prometheus metricshandle.reload_toml(toml)— hot-reload confighandle.shutdown()— graceful shutdown (idempotent; safe to call twice)- Context manager support:
with service.start() as handle: ...
Always use explicit lifecycle management. Prefer context managers or
explicit handle.shutdown() in a finally block. Do not rely on Python
garbage collection to shut down the service — object destruction is a
best-effort fallback, not the lifecycle API.
pproxy Compatibility
Eggress provides a pproxy compatibility surface validated against pproxy==2.7.9 and bounded by the canonical capability manifest. Legacy cipher implementations and unsupported native transports fail explicitly rather than being silently substituted:
- URI Translation:
translate_pproxy_args()converts pproxy CLI arguments to eggress TOML - Same Protocols: HTTP, SOCKS4/4a, SOCKS5, Shadowsocks (AEAD), Trojan
- Same Schedulers: Round-robin, least-connections, first-available
- Enhanced Features: Hot-reload, structured errors, context managers
See docs/python/PPROXY_EMBEDDED_USAGE_PATTERNS.md for migration guidance.
pproxy drop-in API
from eggress import PPProxyService, start_pproxy, check_pproxy_args
# Check compatibility before starting
report = check_pproxy_args(["-l", "socks5://:1080", "-r", "http://proxy:8080"])
print(f"Tier: {report.tier}, OK: {report.ok}")
# Start from pproxy args
with start_pproxy(["-l", "socks5://127.0.0.1:0"]) as handle:
print(handle.bound_addresses)
# Start from local URI
with PPProxyService.from_uri("socks5://127.0.0.1:0") as handle:
print(handle.bound_addresses)
# Start from TOML
with PPProxyService.from_toml(toml_str) as handle:
print(handle.bound_addresses)
The optional eggress-pproxy-compat distribution additionally provides
python -m pproxy, a pproxy console script, and the top-level pproxy
package backed by the same compatibility entry point. pproxy.server helper
calls reuse the existing protocol/proxy adapters, while pproxy.sysproxy
delegates system-proxy apply/rollback to the native backend where the platform
supports it. See the namespace strategy below before installing it.
API Contract (Phase C1)
A machine-readable contract of the bounded pproxy adapter is maintained at
python/compat/pproxy_api_contract.json. The exact upstream installed-package
inventory is maintained separately in
compat/pproxy-2.7.9/namespace-baseline.json and the active parity manifest.
Use scripts/pproxy_surface_probe.py with isolated oracle and wheel
interpreters to compare module names, top-level exports, tracked signatures,
async classification, and class bases. Importability is not a claim that
private pproxy internals are functionally reproduced.
Classification summary
| Tier | Count | Examples |
|---|---|---|
| adapted_target | 3 | Connection, Server, Rule → PPProxyService |
| intentional_non_parity | 1 | DIRECT sentinel |
| internal_observed | 87 | Protocol classes, cipher classes, server internals |
Validation
# Regenerate the contract
python3.11 python/compat/extract_api.py
# Run 56 contract validation tests
python3.11 -m pytest tests/compat/test_pproxy_api_contract.py -v
# Run 46 behavioral probes
python3.11 python/compat/behavioral_probes.py
Namespace strategy
The optional eggress-pproxy-compat distribution installs a bounded top-level
pproxy package containing the documented connection/server factories and
protocol/cipher submodules. The canonical eggress distribution retains
eggress.pproxy and eggress.start_pproxy() for translation and managed-service
workflows. Do not install the compatibility distribution alongside upstream
pproxy in the same environment.
See docs/python/PPROXY_NAMESPACE_STRATEGY.md for the compatibility boundary.
Migrating from pproxy
from eggress import start_pproxy
# Same arguments you'd pass to pproxy
with start_pproxy(["-l", "socks5://:1080", "-r", "http://proxy:8080"]) as handle:
print(handle.bound_addresses)
Or inspect the translation first:
from eggress import translate_pproxy_args
result = translate_pproxy_args(["-l", "socks5://:1080", "-r", "http://proxy:8080"])
print(result.toml) # generated eggress TOML
print(result.warnings) # partial-behavior notes
print(result.unsupported) # unsupported features
Error model
| Exception | Meaning |
|---|---|
EggressError |
Base exception |
ConfigError |
TOML parsing or validation error |
StartupError |
Listener bind or readiness timeout |
ReloadError |
Config reload failure |
ShutdownError |
Runtime shutdown error |
UnsupportedFeatureError |
Feature not supported |
InternalError |
Unexpected internal error |
Limitations
- GIL is released for blocking Rust calls
- Requires Python >= 3.9
- Listener bind changes require restart (not reloadable)
- No logging initialization unless configured in TOML
Non-parity with pproxy
Distinguish runtime capability, service-facade exposure, and dedicated Python
convenience API (see docs/PYTHON_BINDINGS.md and architecture/python-bindings.md):
- Shadowsocks TCP uses standard SIP003 AEAD framing (wire-compatible with
shadowsocks-rust/ssserver/sslocal); multi-hop TCP chains and UDP through composed SOCKS5/Shadowsocks hop chains are supported (seedocs/CAPABILITIES.md) - Generic
RuntimeConfig/EggressConfig::from_tomlsupports Shadowsocks/Trojan listener sections; Python convenience paths focus on SOCKS5/HTTP inbound plus TCP/UDP upstream Shadowsocks in the current release - Legacy stream ciphers (aes-ctr, aes-cfb, rc4-md5, etc.) behind opt-in
legacy-crypto(compatibility-only) - SSH upstreams behind opt-in
ssh(upstream-only); Unix-domain listeners supported by the runtime (UnixListenerConfig, configure via TOML/EggressConfig); transparentredir://supported on Linux - Linux pproxy daemon mode (
--daemon) behind opt-inpproxy-daemon - Standalone UDP relay (
-ul, modestandalone_pproxy_udp) supported - Multiple remotes default to round-robin (matches pproxy behavior)
- Direct fallback requires explicit config
Release files for eggress 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| eggress-1.0.8.tar.gz | 1.1 MB | Details |
Built distributions (wheels)
Total release size: 52.1 MB
Release files / eggress-1.0.8.tar.gz
| Download URL | eggress-1.0.8.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3c5b5fcfe5e2457f4f53a684e381e109f4dd93774b0a5bd27045c2d17c44417
|
|
BLAKE2b-256 checksum How to use checksums |
dd0abf2f174a7e70a26f9e1332aa7a913f355f83dab26b24402e603a3b32e9af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-win_arm64.whl
| Download URL | eggress-1.0.8-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c1c3040108dfbbe0d8aaa70b30c39c1532250014c47b3e80519b9b33433bccf3
|
|
BLAKE2b-256 checksum How to use checksums |
34fe0ae0e8286784f3c3da071a34e06fc24c9324ecd5275bb4ed0c2d1a58b606
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-win_amd64.whl
| Download URL | eggress-1.0.8-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
90eeef1677307316bc6b1589c605cd20aadb418e0313d206e94a5384f7accc54
|
|
BLAKE2b-256 checksum How to use checksums |
19d0de4c774e02d46bdd6ffeda9200647813f0f81ea4237c1cc139f5c20dd010
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | eggress-1.0.8-cp39-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 5.5 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
245f5edfbc09ef5572b4fc707c21c97f9a5afd0d3ad85ee4dc86fc27b14aff8c
|
|
BLAKE2b-256 checksum How to use checksums |
0464ec6cc46be7bf4841e80f5829b69e91f10ecbae45ab86e850ce50757b7bee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-musllinux_1_2_armv7l.whl
| Download URL | eggress-1.0.8-cp39-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.9 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
281b34968557a00ecc4639003920842803ea99a73a71498b0059b6a8c66ae48a
|
|
BLAKE2b-256 checksum How to use checksums |
3766ebe674916e30435367b5809d7981697a0fb6ae8ee73912b322e13dee96af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | eggress-1.0.8-cp39-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.9 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
3c36e066118c39089990da0cc12f2ee0db39fddc72639bca57967f066b48f12b
|
|
BLAKE2b-256 checksum How to use checksums |
613525eaebedd45858d8b0327a17d03fbd3db7cacb8edfdc471fe08e7363a151
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-manylinux_2_28_armv7l.whl
| Download URL | eggress-1.0.8-cp39-abi3-manylinux_2_28_armv7l.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
31a295de4a2ba429cf95128f53d1de4548502b8bd643b2a8573119a9e9676e6f
|
|
BLAKE2b-256 checksum How to use checksums |
0041411c3054df5715e1e7fdd1bdc2574f46eb2bcbd326b15e3c4f15d35ca7b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | eggress-1.0.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
4118d16c8e9f2db2cef34d7f20967920b478a2806d32a5a904c583f6bac0a454
|
|
BLAKE2b-256 checksum How to use checksums |
d34addacb8ba2f6fb07b3de3355e75a0b7ac39e871dce8aae00dfe3ff9a130bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | eggress-1.0.8-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
56be8ef3c1bb1e528bc51a2d37e4a024a9e208ed7ec1c2024af3536ea3a1c7eb
|
|
BLAKE2b-256 checksum How to use checksums |
70732217bc7ddecdd21b3586c394f33c70e10d0f7650b6ea4ba581c14a6cc71a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | eggress-1.0.8-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.8 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
10f3a9281416e36d32b98c0d9fd3ac1a5c8cac26d2a1cd64168e6e0d6110ce5c
|
|
BLAKE2b-256 checksum How to use checksums |
38160818729224acf782d4c4ba3fad811b512a3908e3b7c4669801c1cde63314
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency logRelease files / eggress-1.0.8-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | eggress-1.0.8-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
0c644a143def9ce398cafeb613caee1e37d7475a7abaab6a56d26ade6a5cea41
|
|
BLAKE2b-256 checksum How to use checksums |
5e29a491668d56fd7314aaa23cf072ba7088610b5ec5c5d6aae86429ec977c92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.
Transparency log