Make Koa's proxy support safe for applications that sit behind a known chain of reverse proxies.
Make Koa's proxy support safe for applications that sit behind a known chain of reverse proxies.: a task in MiMo-V2.6-RL-harbor-code: MiMo-V2.6-RL Code (Harbor) (Harbor dataset). Keep the existing app.proxy = false and app.proxy = true modes, and additionally allow app.proxy to be a trust…
The task
Keep the existing `app.proxy = false` and `app.proxy = true` modes, and additionally allow `app.proxy` to be a trust predicate with the signature `function (address, hop)`. A truthy result means that hop is trusted. The socket's `remoteAddress` is hop 0. For `X-Forwarded-For`, trim comma-separated entries and ignore…
Part of FineEnvs/MiMo-V2.6-RL-harbor-code.