pproxy - A Powerful Regex-Based Proxy Server

2.7.9 · active · verified Fri Apr 17

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.

Common errors

Warnings

Install

Imports

Quickstart

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.")

view raw JSON →