Agent-Gateway Reverse Proxy

Wikipedia proxy with Agent-Aware Compression Protocol (agent_codec).

Standard Routes passthrough

PathUpstream
/wiki/* en.wikipedia.org — HTML passthrough
/wiki_media/* upload.wikimedia.org — binary passthrough

Agent-Optimised Routes DOM distillation + gzip

PathUpstreamProcessing
/agent/wiki/* en.wikipedia.org distill_html() → rewrite_body() → compress()
Headers: X-Agent-Compressed, X-Compression-Ratio, X-Original-Size, X-Distilled-Size
/agent/wiki_media/* upload.wikimedia.org compress() — skips JPEG/PNG/WebP via should_compress()

Part of the Agent-Aware Networking experiment — implements §3.3 DOM-to-Token Distillation from the A-GW proposal.