Skip to content

feat: trustProxy: 'railway' - #50

Merged
cport1 merged 2 commits into
mainfrom
feat/trust-proxy-railway
Sep 27, 2026
Merged

cport1 merged 2 commits into
mainfrom
feat/trust-proxy-railway

Conversation

@cport1

@cport1 cport1 commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Adds 'railway' to TrustedProxies, resolved in the shared resolveClientIp so every adapter gets it.

Railway's edge replaces any client-sent X-Forwarded-For with exactly <client>, <edge> (checked against a live deploy: forged values are dropped). A depth of 1, which is also the Next.js and Hono default, names the edge for every visitor. 'railway' answers exactly what a depth of 2 answers; the tests pin that and fail if the depth is changed to 1.

Also documents that Fastify 5.12+ fails closed on a numeric server trustProxy (request.ip stays the socket address), so the hop count belongs on the plugin.

All workspace tests, build, lint and the edge check pass locally.

🤖 Generated with Claude Code

cport1 and others added 2 commits September 26, 2026 22:27
Railway's edge replaces any client-sent X-Forwarded-For with exactly
'<client>, <edge>', so the visitor is two entries from the right. A depth
of 1 (and the Next.js and Hono default) names the edge for every visitor.
'railway' resolves exactly as a depth of 2, in the one shared resolver, so
every adapter gets it.

Also documents that Fastify 5.12+ ignores a numeric server trustProxy
(it fails closed), so the hop count belongs on the plugin.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@cport1
cport1 merged commit 7a5c6f4 into main Sep 27, 2026
2 checks passed
@cport1
cport1 deleted the feat/trust-proxy-railway branch September 27, 2026 03:30
@cport1 cport1 mentioned this pull request Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant