On the edge adapter, cf-connecting-ip is only used for WebSocket upgrades (src/edge.ts:33). HTTP requests leave ctx.ip as '', or the x-forwarded-for value under trustProxy. That is the same symptom #116 fixed for Deno and Bun: IP-keyed plugins such as rate-limit put every caller in one bucket.
This was left out of #116 on purpose. Trusting cf-connecting-ip is only correct behind Cloudflare, because elsewhere any client can set the header. It needs a decision first:
trust it always on the edge adapter;
trust it only under trustProxy;
or add an explicit opt-in.
Whichever is chosen, WebSocket upgrades should behave the same way. Today they trust the header unconditionally.
On the edge adapter, `cf-connecting-ip` is only used for WebSocket upgrades (`src/edge.ts:33`). HTTP requests leave `ctx.ip` as `''`, or the `x-forwarded-for` value under `trustProxy`. That is the same symptom #116 fixed for Deno and Bun: IP-keyed plugins such as rate-limit put every caller in one bucket.
This was left out of #116 on purpose. Trusting `cf-connecting-ip` is only correct behind Cloudflare, because elsewhere any client can set the header. It needs a decision first:
- trust it always on the edge adapter;
- trust it only under `trustProxy`;
- or add an explicit opt-in.
Whichever is chosen, WebSocket upgrades should behave the same way. Today they trust the header unconditionally.
Fixed in 26.11.0-rc.1 (88cbe41). From the changelog:
Edge WebSocket upgrades no longer trust cf-connecting-ip by default (#119). edgeHandler copied the header into ctx.ip on every upgrade, so any client that sent it chose its own address. It now counts only under trustProxy: true, the same rule HTTP follows. Without it, ctx.ip on an edge WebSocket is '', as it already was on edge HTTP: workerd exposes no peer address. An app behind Cloudflare that keys anything on the WebSocket IP needs createApp({ trustProxy: true }).
Edge HTTP fills ctx.ip from cf-connecting-ip under trustProxy (#119). edgeHandler never read the header for HTTP, so IP-keyed plugins such as rate-limit saw '', one bucket for every client. Under trustProxy: true the header now sets ctx.ip, and it wins over x-forwarded-for, because Cloudflare sets it itself while XFF can carry hops the client supplied. Without trustProxy it is ignored. Only edgeHandler reads it: the Node, Deno and Bun adapters, and a bare app.fetch, ignore it as before.
Fixed in **26.11.0-rc.1** (`88cbe41`). From the changelog:
- **Edge WebSocket upgrades no longer trust `cf-connecting-ip` by default** (#119). `edgeHandler` copied the header into `ctx.ip` on every upgrade, so any client that sent it chose its own address. It now counts only under `trustProxy: true`, the same rule HTTP follows. Without it, `ctx.ip` on an edge WebSocket is `''`, as it already was on edge HTTP: workerd exposes no peer address. An app behind Cloudflare that keys anything on the WebSocket IP needs `createApp({ trustProxy: true })`.
- **Edge HTTP fills `ctx.ip` from `cf-connecting-ip` under `trustProxy`** (#119). `edgeHandler` never read the header for HTTP, so IP-keyed plugins such as rate-limit saw `''`, one bucket for every client. Under `trustProxy: true` the header now sets `ctx.ip`, and it wins over `x-forwarded-for`, because Cloudflare sets it itself while XFF can carry hops the client supplied. Without `trustProxy` it is ignored. Only `edgeHandler` reads it: the Node, Deno and Bun adapters, and a bare `app.fetch`, ignore it as before.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
On the edge adapter,
cf-connecting-ipis only used for WebSocket upgrades (src/edge.ts:33). HTTP requests leavectx.ipas'', or thex-forwarded-forvalue undertrustProxy. That is the same symptom #116 fixed for Deno and Bun: IP-keyed plugins such as rate-limit put every caller in one bucket.This was left out of #116 on purpose. Trusting
cf-connecting-ipis only correct behind Cloudflare, because elsewhere any client can set the header. It needs a decision first:trustProxy;Whichever is chosen, WebSocket upgrades should behave the same way. Today they trust the header unconditionally.
Merged into develop in #139 (CARD-23, FPRD-001c, 2026-10-23). Left open until the 1c acceptance gate (CARD-22), per the 1a/1b convention.
Fixed in 26.11.0-rc.1 (
88cbe41). From the changelog:Edge WebSocket upgrades no longer trust
cf-connecting-ipby default (#119).edgeHandlercopied the header intoctx.ipon every upgrade, so any client that sent it chose its own address. It now counts only undertrustProxy: true, the same rule HTTP follows. Without it,ctx.ipon an edge WebSocket is'', as it already was on edge HTTP: workerd exposes no peer address. An app behind Cloudflare that keys anything on the WebSocket IP needscreateApp({ trustProxy: true }).Edge HTTP fills
ctx.ipfromcf-connecting-ipundertrustProxy(#119).edgeHandlernever read the header for HTTP, so IP-keyed plugins such as rate-limit saw'', one bucket for every client. UndertrustProxy: truethe header now setsctx.ip, and it wins overx-forwarded-for, because Cloudflare sets it itself while XFF can carry hops the client supplied. WithouttrustProxyit is ignored. OnlyedgeHandlerreads it: the Node, Deno and Bun adapters, and a bareapp.fetch, ignore it as before.