UNPKG

781 BTypeScriptView Raw
1// Type definitions for proxy-addr 2.0
2// Project: https://github.com/jshttp/proxy-addr#readme
3// Definitions by: BendingBender <https://github.com/BendingBender>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node" />
7import { IncomingMessage } from 'http';
8
9export = proxyAddr;
10
11declare function proxyAddr(req: IncomingMessage, trust: proxyAddr.Address | proxyAddr.Address[] | ((addr: string, i: number) => boolean)): string;
12
13declare namespace proxyAddr {
14 function all(req: IncomingMessage, trust?: Address | Address[] | ((addr: string, i: number) => boolean)): string[];
15 function compile(val: Address | Address[]): (addr: string, i: number) => boolean;
16
17 type Address = 'loopback' | 'linklocal' | 'uniquelocal' | string;
18}