Registry / http-networking / pproxy

pproxy

JSON →
library2.7.9pypypiunverified

pproxy is a Python proxy server that enables tunneling among remote servers using configurable regex rules. It supports various protocols like HTTP, SOCKS, and SSL. The current version is 2.7.9, with active development and releases typically occurring every few months to address bug fixes and new features.

pip install pproxy
INSTALL
IMPORT
SIG · PPROXY
P
pproxy
http-networkingpythonv2.7.9
Install
1.6s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.7.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.7MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
✓ from pproxy import main
The primary programmatic entry point for pproxy, typically used to run the server with simulated command-line arguments.

This quickstart demonstrates how to programmatically start a pproxy server using its `main` function. It configures the proxy to listen for HTTP connections on port 8080 and forward them to a remote SOCKS5 proxy running on localhost:1080. This mimics command-line invocation for embedded use.

import sys from pproxy import main # Configure pproxy to listen on HTTP port 8080 # and forward all requests to a SOCKS5 proxy at 127.0.0.1:1080. # This simulates running: python -m pproxy -l http://:8080 -r socks5://127.0.0.1:1080 sys.argv = ['pproxy', '-l', 'http://:8080', '-r', 'socks5://127.0.0.1:1080'] print("Starting pproxy server on http://:8080, forwarding to socks5://127.0.0.1:1080...") print("Press Ctrl+C to stop.") try: main() except KeyboardInterrupt: print("\npproxy server stopped.")
pproxy --version
Debug
Known issues
gotchapproxy migrated to asyncio in version 2.0.0. While the command-line interface remains consistent, programmatic users integrating `pproxy.main()` into existing blocking codebases might encounter unexpected behavior or need to adapt their environment to run `asyncio` event loops.
fix
Ensure your application's main loop or context is compatible with asyncio when embedding `pproxy.main()`. If you are running `main()` directly, it will handle the event loop.
affects: >=2.0.0
gotchaThe `-l` (listen) and `-r` (remote) arguments require specific URL-like formats (e.g., `http://:8080`, `socks5://user:pass@host:port`). Omitting the scheme (e.g., just `:8080`) or providing an incorrect format is a common mistake that leads to parsing errors.
fix
Always include the protocol scheme (e.g., `http://`, `https://`, `socks5://`) when specifying listen and remote addresses. Consult the documentation for exact syntax.
affects: All versions
gotchaThe `-r` (remote) rules use full Python regular expressions to match incoming requests against defined patterns. Users often expect simple wildcard matching (e.g., `*`) and are surprised by the full regex syntax, leading to misconfigured routing.
fix
Familiarize yourself with Python's `re` module syntax when defining complex remote rules. Test your regex patterns thoroughly to ensure they match traffic as intended.
affects: All versions
Upgrade
Version history
2.7.9latest on PyPI · released Jan 16, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources