WebSocketRequestTransform | mockttp

This defines the request transforms that we support for all passed through requests (both HTTP and WebSockets).

Hierarchy (view full)

Properties

OptionalmatchReplaceHost

matchReplaceHost?: {
    replacements: MatchReplacePairs;
    updateHostHeader?: string | boolean;
}

OptionalmatchReplacePath

Perform a series of string match & replace operations on the request path.

OptionalmatchReplaceQuery

Perform a series of string match & replace operations on the request query string.

OptionalreplaceHost

replaceHost?: {
    targetHost: string;
    updateHostHeader?: string | boolean;
}

OptionalsetProtocol

setProtocol?: "wss" | "ws"

Override the request protocol. If replaceHost & matchReplaceHost are not specified and the URL no explicitly specified port, this will automatically switch to the appropriate port (e.g. from 80 to 443).