- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| agents | ||
| docs | ||
| lib | ||
| src | ||
| temp | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Changelog.md | ||
| README.md | ||
proxy — HTTP/HTTPS proxy with domain allow/deny lists
An explicit HTTP proxy (standard proxy protocol only — CONNECT tunnelling
and absolute-form HTTP, deliberately not SOCKS) with per-domain allow and
deny lists, five access policies, and a terminal "ask" flow that lets you
approve or deny unknown domains as connections arrive.
It is built as two crates:
http-proxy(library, inlib/) — the proxy protocol itself. It owns no listener: inbound connections are handed in as generic tokio streams (TCP sockets, or SSH forwarding channels fromsocket-ssh), and the library makes its own outbound TCP connections. Everything else lives on top of it.proxyd(binary, workspace root) — TCP listener, TOML config with atomic write-back, logging, and the interactive ask prompt.
Full documentation lives in the mdbook under docs/
(mdbook build docs -d docs/book, then open docs/book/index.html).
Quickstart
cargo build
cat > proxyd.toml <<'EOF'
policy = "allow"
[server]
listen = "127.0.0.1:8080"
[allow_list]
"example.com" = "main site"
"*.example.org" = "all subdomains"
[deny_list]
"ads.example" = "tracker"
EOF
./target/debug/proxyd --check # validate the config
./target/debug/proxyd # run it
curl -x http://127.0.0.1:8080 http://example.com/
Policies
| Policy | allow-listed | deny-listed | unknown |
|---|---|---|---|
unlocked |
allow | allow | allow, no side effect |
allow |
allow | deny | allow, auto-added to allow list |
deny |
allow | deny | deny, auto-added to deny list |
ask |
allow | deny | hold the connection, prompt |
locked |
deny | deny | deny |
Auto-added entries are written back to the config file with an
auto-added <timestamp> comment. Under ask, each unknown domain produces
one queued question on the terminal with four answers: [a]llow, [d]eny
(permanent, recorded in the list with an asked, allowed/denied <timestamp>
comment), allow [o]nce and deny on[c]e (resolve only that one
connection). Wildcards (*.example.com, subdomains only; bare * matches
everything) and IP literals are valid list entries; deny wins over allow.
See docs/src/matching.md and
docs/src/policies-and-asking.md.
Library use
Embed http-proxy to drive the proxy from your own listener — for example
connections forwarded through a socket-ssh channel:
use http_proxy::{Proxy, ProxyConfig, Policy};
let (proxy, mut events) = Proxy::new(ProxyConfig::default(), Policy::Ask);
// spawn one task per event: prompt, answer via allow_once/deny_once or
// add_allow/add_deny, and persist lists yourself
// for each accepted stream:
proxy.handle_connection(stream, peer).await?;
See docs/src/library.md for the embedding guide and
docs/src/limitations.md for known trade-offs
(denied-after-200 CONNECT shows the client a TLS error, config rewrite
drops hand-written comments, HTTP/1.x only).
Project structure
lib/ http-proxy library crate
src/ proxyd binary (CLI, config, runtime, prompt)
docs/ mdbook user documentation (src/, built to docs/book/)
agents/ plans, rules and memory for agent workers
Development
cargo build
cargo test --workspace # unit + integration tests
cargo clippy --workspace --all-targets
cargo fmt --check
mdbook build docs -d docs/book # user documentation
License
MIT