"""Proxy fallback middleware. Intercepts requests for sub-resources of proxied dev servers. When a page is loaded through /api/proxy/{port}/, its sub-resources (JS modules, CSS, images) use absolute paths like /@vite/client or /node_modules/... which resolve against the cptr origin. This middleware detects those requests via the Referer header and a path-to-port cache, then proxies them to the correct local port. The cache chain works like this: 1. /api/proxy/5174/ loads HTML with