mitm-core / RequestContext
Type Alias: RequestContext
RequestContext =
object
Defined in: src/core/scope/types.ts:74
Contains the data associated with an individual request-response transaction passing through the proxy.
Separates client-facing request data, upstream request data, and the target information used for routing. WebSocket-specific metadata is available when the transaction involves an upgrade.
Properties
client
client:
object
Defined in: src/core/scope/types.ts:79
Client-facing HTTP request and response information.
headers?
optionalheaders?:IncomingHttpHeaders
Headers associated with the client request.
method?
optionalmethod?:string
HTTP method of the client request, when available.
req?
optionalreq?:IncomingMessage
Incoming request received from the client, when available.
res?
optionalres?:ServerResponse
Response object used to send data back to the client, when available.
url?
optionalurl?:string
Request URL as received or represented by the proxy.
requestId
requestId:
string
Defined in: src/core/scope/types.ts:76
Unique identifier assigned to this request-response transaction.
target
target:
object
Defined in: src/core/scope/types.ts:106
Original and current destination information for routing.
host?
optionalhost?:string
Current target host used by the proxy, when available.
originalHost?
optionaloriginalHost?:string
Original host extracted from the client request, when available.
originalUrl?
optionaloriginalUrl?:string
Original URL extracted from the client request, when available.
url?
optionalurl?:string
Current target URL used by the proxy, when available.
upstream
upstream:
object
Defined in: src/core/scope/types.ts:97
Upstream HTTP request and response information.
req?
optionalreq?:ClientRequest
Outgoing request sent to the upstream server, when available.
res?
optionalres?:IncomingMessage
Response received from the upstream server, when available.
webSocket?
optionalwebSocket?:WebSocketContext
Defined in: src/core/scope/types.ts:126
WebSocket-specific state and endpoint references.
Present for WebSocket-related transactions when the proxy populates this field; otherwise, it is undefined.
