CodeSampleX

サンプル

Show how `trust proxy` controls whether Express reads `X-Forwarded-For` for `req.ip` and `req.ips`.

sha256:3a4cd850e24a4583db4efbe2c07c6463fb853a6a7bb75a6d1f365a1b70a6bb0c

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Show how `trust proxy` controls whether Express reads `X-Forwarded-For` for `req.ip` and `req.ips`. HOW
パッケージ
express 4.19.1
環境
node
作成日
2026-08-17T03:16:22Z

よくある思い込み

Forwarded client IP headers should always be reflected in `req.ip` even when `trust proxy` is disabled.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート