Skip to main content

forward_request

Function forward_request 

Source
pub async fn forward_request<S>(
    inbound: &mut S,
    request_bytes: &[u8],
    body: &[u8],
    upstream: UpstreamSpec<'_>,
    audit: AuditCtx<'_>,
) -> Result<u16>
where S: AsyncRead + AsyncWrite + Unpin,
Expand description

Connect to the upstream, write request_bytes + body, stream the response back into inbound, and emit the L7 audit event.

Returns the response status code (or 502 if the upstream sent something unparseable).