X Hamster.proxy !!install!! -

# In one terminal – start the proxy hamster-proxy -p 8899 --log-level debug

| Feature | Description | |---------|-------------| | (only cryptography for TLS) | Works on any Python ≥3.9, no heavy external libraries. | | Asyncio‑first design | Built on asyncio + httpx ‑style API for non‑blocking I/O. | | Pluggable middleware stack | Similar to express or starlette – you can drop in request‑/response‑handlers. | | Built‑in TLS “man‑in‑the‑middle” (optional, safe by default) | Perfect for testing APIs that require client certificates. | | Dynamic routing & policy engine | Route traffic based on host, path, method, or even Geo‑IP. | | Observability out‑of‑the‑box | Prometheus metrics, structured JSON logs, and an optional UI dashboard. | | Small footprint – ~250 KB source, < 5 MB RAM under load. | Ideal for edge devices, CI pipelines, and dev containers. | x hamster.proxy

Use MITM only in trusted environments (dev, test, or with explicit consent). The proxy never stores private keys beyond the process’ memory. # In one terminal – start the proxy

@proxy.middleware async def log_json_body(request: Request, call_next): if request.method == "POST" and request.headers.get("Content-Type") == "application/json": body = await request.body() # returns bytes print("🧾 JSON payload:", body.decode()) return await call_next(request) | | Small footprint – ~250 KB source,