TrustProxyOptions
How the client address is derived.
How the client address is derived.
Import#
ts
import type { TrustProxyOptions } from "@shadow-js/dusk/server";
Signature#
ts
interface TrustProxyOptions {
/** Header that carries the client address. Default `"x-forwarded-for"`. */
readonly header?: string;
/**
* For a list header such as `x-forwarded-for`: how many proxies of yours append to it. The
* address is the entry that many positions from the right. Default 1.
*/
readonly hops?: number;
/**
* Only trust the header when the connection comes from one of these addresses (the proxies).
* Without it the header is trusted from any peer, which is only safe when the server is not
* reachable except through the proxy.
*/
readonly trustedPeers?: readonly string[];
}
Members#
| Name | Type | Description |
|---|---|---|
header? |
readonly header?: string |
Header that carries the client address. Default "x-forwarded-for". |
hops? |
readonly hops?: number |
For a list header such as x-forwarded-for: how many proxies of yours append to it. The address is the entry that many positions from the right. Default 1. |
trustedPeers? |
readonly trustedPeers?: readonly string[] |
Only trust the header when the connection comes from one of these addresses (the proxies). Without it the header is trusted from any peer, which is only safe when the server is not reachable except through the proxy. |