interface ProxyOptions {
    agent?: any;
    auth?: string;
    autoRewrite?: boolean;
    buffer?: Stream;
    bypass?: ((req, res, options) => undefined | null | string | false | void);
    changeOrigin?: boolean;
    configure?: ((proxy, options) => void);
    cookieDomainRewrite?: string | false | {
        [oldDomain: string]: string;
    };
    cookiePathRewrite?: string | false | {
        [oldPath: string]: string;
    };
    followRedirects?: boolean;
    forward?: ProxyTargetUrl;
    headers?: {
        [header: string]: string;
    };
    hostRewrite?: string;
    ignorePath?: boolean;
    localAddress?: string;
    prependPath?: boolean;
    preserveHeaderKeyCase?: boolean;
    protocolRewrite?: string;
    proxyTimeout?: number;
    rewrite?: ((path) => string);
    secure?: boolean;
    selfHandleResponse?: boolean;
    ssl?: any;
    target?: ProxyTarget;
    timeout?: number;
    toProxy?: boolean;
    ws?: boolean;
    xfwd?: boolean;
}

Hierarchy (view full)

Properties

agent?: any

Object to be passed to http(s).request.

auth?: string

Basic authentication i.e. 'user:password' to compute an Authorization header.

autoRewrite?: boolean

Rewrites the location host/ port on (301 / 302 / 307 / 308) redirects based on requested host/ port.Default: false.

buffer?: Stream

Buffer

bypass?: ((req, res, options) => undefined | null | string | false | void)

webpack-dev-server style bypass function

Type declaration

changeOrigin?: boolean

Changes the origin of the host header to the target URL.

configure?: ((proxy, options) => void)

configure the proxy server (e.g. listen to events)

Type declaration

cookieDomainRewrite?: string | false | {
    [oldDomain: string]: string;
}

rewrites domain of set-cookie headers.

Type declaration

  • [oldDomain: string]: string
cookiePathRewrite?: string | false | {
    [oldPath: string]: string;
}

rewrites path of set-cookie headers. Default: false

Type declaration

  • [oldPath: string]: string
followRedirects?: boolean

Specify whether you want to follow redirects. Default: false

forward?: ProxyTargetUrl

URL string to be parsed with the url module.

headers?: {
    [header: string]: string;
}

object with extra headers to be added to target requests.

Type declaration

  • [header: string]: string
hostRewrite?: string

Rewrites the location hostname on (301 / 302 / 307 / 308) redirects, Default: null.

ignorePath?: boolean

Specify whether you want to ignore the proxy path of the incoming request.

localAddress?: string

Local interface string to bind for outgoing connections.

prependPath?: boolean

Specify whether you want to prepend the target's path to the proxy path.

preserveHeaderKeyCase?: boolean

specify whether you want to keep letter case of response header key

protocolRewrite?: string

Rewrites the location protocol on (301 / 302 / 307 / 308) redirects to 'http' or 'https'.Default: null.

proxyTimeout?: number

Timeout (in milliseconds) when proxy receives no response from target. Default: 120000 (2 minutes)

rewrite?: ((path) => string)

rewrite path

Type declaration

    • (path): string
    • Parameters

      • path: string

      Returns string

secure?: boolean

Verify SSL certificate.

selfHandleResponse?: boolean

If set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the proxyRes event

ssl?: any

Object to be passed to https.createServer().

target?: ProxyTarget

URL string to be parsed with the url module.

timeout?: number

Timeout (in milliseconds) for incoming requests

toProxy?: boolean

Explicitly specify if we are proxying to another proxy.

ws?: boolean

If you want to proxy websockets.

xfwd?: boolean

Adds x- forward headers.