Skip to content

refactor: resolve client IP through trusted proxies - #2580

Merged
Philipinho merged 2 commits into
mainfrom
refactor/request-ip
Oct 15, 2026
Merged

Philipinho merged 2 commits into
mainfrom
refactor/request-ip

Conversation

@Philipinho

Copy link
Copy Markdown
Member
  • replace fastify-ip with an onRequest hook that sets request.ip from trusted proxy hops
  • read CF-Connecting-IP only when the hop is a Cloudflare edge
  • strip ports and validate the address before it is stored or used for rate limits
  • log the resolved IP in request log lines
  • add @fastify/proxy-addr as a direct dependency

- replace fastify-ip with an onRequest hook that sets request.ip from trusted proxy hops
- read CF-Connecting-IP only when the hop is a Cloudflare edge
- strip ports and validate the address before it is stored or used for rate limits
- log the resolved IP in request log lines
- add @fastify/proxy-addr as a direct dependency
@socket-security

socket-security Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​fastify/​proxy-addr@​5.0.0 ⏵ 5.1.2100 +110010089100

View full report

- set request.ip with the same onRequest hook as the main server
- carry the resolved client IP on collab WebSocket connections
@Philipinho
Philipinho merged commit a306d92 into main Oct 15, 2026
6 checks passed
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