Python proxy
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
iceboy 492038c53a Add configurable SOCKS5 proxy listeners
- Implement no-authentication SOCKS5 CONNECT handling for IPv4, IPv6, and domains
- Parse and validate handler configuration, connector references, and listen uniqueness
- Run configured listeners by default while preserving optional stdio TCP connect mode
- Move Shadowsocks client streaming into the connector and accept parsed endpoints
- Make callers own stream cleanup so relays close resources at the correct lifecycle boundary
- Document SOCKS listener setup and add coverage for handlers, CLI, config, and streams
2026-10-24 20:39:20 -07:00
pyrox Add configurable SOCKS5 proxy listeners 2026-10-24 20:39:20 -07:00
tests Add configurable SOCKS5 proxy listeners 2026-10-24 20:39:20 -07:00
.gitignore initial commit 2026-10-18 13:22:19 -07:00
LICENSE initial commit 2026-10-18 13:22:19 -07:00
pyproject.toml initial commit 2026-10-18 13:22:19 -07:00
README.md Add configurable SOCKS5 proxy listeners 2026-10-24 20:39:20 -07:00

Pyrox

Python proxy.

Config

[[connectors]]
name = "proxy"
type = "shadowsocks"
server = "127.0.0.1:8388"
method = "2022-blake3-aes-128-gcm"
password = "AAAAAAAAAAAAAAAAAAAAAA"

The 2022 methods expect password to be unpadded Base64-encoded key material of the method's exact key size.

SOCKS handler

Add a SOCKS5 listener that sends TCP CONNECT requests through a named connector:

[[handlers]]
listen = "127.0.0.1:1080"
type = "socks"
connector = "proxy"

Run the configured handlers with python -m pyrox --config proxy.toml. The SOCKS handler supports no-authentication TCP CONNECT requests for IPv4, IPv6, and domain targets.

TCP connect

The process connects stdin/stdout to a target through the named connector when --tcp-connect-target is specified:

python -m pyrox \
  --config proxy.toml \
  --tcp-connect-target example.com:443 \
  --tcp-connect-with proxy

Development

Install the package and dependencies with python -m pip install ..

License

Apache 2.0. See the LICENSE file.