proxy-client-address
Forward the real client address from a server-side proxy to a backend without trusting forgeable headers.
Skill by KhaledSaeed18
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/khaledsaeed18-proxy-client-address
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, devops
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/proxy-client-address
What's inside
- Skill name
proxy-client-address- Description
- Forward the real client address from a server-side proxy to a backend without trusting forgeable headers. Use when an API behind a BFF or reverse proxy rate-limits or audits every user as one address.
- License
- MIT
- Instructions
- 31 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- snippets.md · reference/
SKILL.md (first lines)
When a browser calls a front-end server that forwards to an API, the API's peer is the front-end for every user: one rate-limit bucket and one audit address for everyone. Fix it with a named address the API believes only next to a shared secret, derived from the one forwarded header the edge proxy wrote itself.
## Hard rules: never break these
- **Never trust `X-Forwarded-For` from the client side.** Only the entry the edge proxy appended is real; confirm which entry that is for the proxy in front of you before relying on it.
- **The secret is runtime, server-only, identical on both sides,** generated by the owner (`openssl rand -base64 32`), pasted into both deployments, never in a repository or a client bundle.
- **Strip the headers on the way in.** The front-end deletes any `x-<app>-proxy-secret` or `x-<app>-client-ip` a browser sent before setting its own; the API deletes both after reading them.
- **Compare the secret in constant time** on digests, so length and content leak nothing.
- **Without the secret, behave as before.** The front-end falls back to the plain rewrite; the API falls back to `req.ip`. Rollout is safe in any order.
## Step 1: Establish the proxy's behaviour
Read the edge proxy's configuration (Traefik: `docker inspect coolify-proxy --format '{{json .Args}}' | grep -i forwarded`). With no trusted IPs configured, Traefik discards client-sent `X-Forwarded-*` and writes the peer address itself, so the **last** entry is the client; a platform edge behaves the same. If trusted IPs or `insecure` are set, the client's forged entries survive in front of the real one and the last entry is still the real one. A Node server does not append. Document the finding.
## Step 2: Front-end side (the BFF)
In the Next.js proxy (or middleware), for `/api/*` requests: when the secret is configured, rewrite to the API origin with two added request headers, else return nothing and let `next.config` rewrites handle it. Server-side fetches (Server Components) add the same headers from `next/headers`. Snippets in [reference/snippets.md](./reference/snippets.md).
## Step 3: API side
A middleware early in the chain: read both headers, delete them, verify the presented secret against the configured one on SHA-256 digests with `timingSafeEqual`, accept the named address only if it is a valid IP, else use `req.ip`. Store the result on the request (`req.clientIp`) and make the rate limiter's key generator and the audit writer read it. `trust proxy` stays set for `req.ip` to be meaningful behind the edge.
## Step 4: Roll out and prove it
1. Ship both code sides (they are inert without the secret).
2. Owner sets `API_PROXY_SECRET` on the front-end app and `DASHBOARD_PROXY_SECRET` (or the chosen name) on the API, same value, then redeploys both.
3. Prove it: a request through the front-end to a non-existent API route with a forged `X-Forwarded-For: 203.0.113.9`, from two different networks, must be logged by the API with each real address; the same forged header plus a wrong secret sent straight to the API must be logged with the sender's address. The `deploy-verification` skill has the commands.
Report the proxy finding, the header names chosen, the variable names on each side, and the proof lines from the API log.From KhaledSaeed18/dotclaude, MIT.
More from KhaledSaeed18/dotclaude
- 0.619score
ghcr-coolify-pipeline
KhaledSaeed18
Write the single GitHub Actions workflow that takes a repository from pull request to production through GHCR and Coolify.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
coolify-image-app
KhaledSaeed18
Create and configure a Coolify application that runs a prebuilt image from a registry.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
coolify-vps-baseline
KhaledSaeed18
Prepare a Linux VPS to run production containers under Coolify.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
deploy-verification
KhaledSaeed18
Prove a deployment from the server side.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
express-prisma-coolify-image
KhaledSaeed18
Package an Express and Prisma API as a runtime-only image that migrates its Postgres database at start.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
live-domain-cutover
KhaledSaeed18
Move a live domain from one host to another without downtime or lost sessions, with a rehearsal, a timed DNS switch, a soak and the old host removed.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
nextjs-coolify-image
KhaledSaeed18
Package a Next.js app as a runtime-only container image with a health probe and a fast shutdown.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
vps-ops-toolkit
KhaledSaeed18
Install host operations on a VPS, with a cron health check that alerts on change, restore-verified encrypted database backups, and an installer.
SkillAFreshness: A★ 5Claude Code +9 - 0.579score
dockerfile-best-practices
KhaledSaeed18
Write or review a Dockerfile and compose setup for a production service: multi-stage builds that ship only the runtime, pinned base images, layer order for…
SkillBFreshness: B★ 5Claude Code +9 - 0.579score
adr-writing
KhaledSaeed18
Write Architecture Decision Records that a future engineer can act on: a numbered, immutable record with the context that forced the decision, the options…
SkillBFreshness: B★ 5Claude Code +9 - 0.579score
openapi-spec
KhaledSaeed18
Write, generate, or review an OpenAPI 3.1 specification for an HTTP API so that it is accurate to the implementation, complete for consumers (schemas…
SkillBFreshness: B★ 5Claude Code +9 - 0.579score
api-design-review
KhaledSaeed18
Review an API contract (REST or GraphQL) before or while it is implemented, checking resource naming, HTTP semantics, status codes, error shape, pagination…
SkillBFreshness: B★ 5Claude Code +9
Signals
- Stars
- 5
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 5, 2026 (23 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/KhaledSaeed18/dotclaude
- Website
- dotclaude.khaledsaeed.tech/
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from KhaledSaeed18
- 0.619score
ghcr-coolify-pipeline
KhaledSaeed18
Write the single GitHub Actions workflow that takes a repository from pull request to production through GHCR and Coolify.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
express-prisma-coolify-image
KhaledSaeed18
Package an Express and Prisma API as a runtime-only image that migrates its Postgres database at start.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
coolify-image-app
KhaledSaeed18
Create and configure a Coolify application that runs a prebuilt image from a registry.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
coolify-vps-baseline
KhaledSaeed18
Prepare a Linux VPS to run production containers under Coolify.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
deploy-verification
KhaledSaeed18
Prove a deployment from the server side.
SkillAFreshness: A★ 5Claude Code +9 - 0.619score
live-domain-cutover
KhaledSaeed18
Move a live domain from one host to another without downtime or lost sessions, with a rehearsal, a timed DNS switch, a soak and the old host removed.
SkillAFreshness: A★ 5Claude Code +9
Cite this page
proxy-client-address skill. Agent Mart. https://agentmart.dev/skills/khaledsaeed18-proxy-client-address (last updated 2026-10-24)