X Hamster.proxy -
def smart_route(request: Request) -> str | None: # 1️⃣ Route all *.cdn.example.com to the nearest edge node if re.match(r".*\.cdn\.example\.com$", request.host): return f"https://edge-{request.geo.region.lower()
@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) x hamster.proxy
Key points :
# Install from PyPI (includes optional extras for TLS and metrics) pip install "x-hamster-proxy[tls,metrics]" def smart_route(request: Request) -> str | None: #
# Verify the entrypoint works hamster-proxy --help def smart_route(request: Request) ->