MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / relay_http_request

Function relay_http_request

crates/openshell-supervisor-network/src/l7/rest.rs:357–367  ·  view source on GitHub ↗

Forward an allowed HTTP request to upstream and relay the response back. Returns the relay outcome indicating whether the connection is reusable, consumed, or has been upgraded (e.g. WebSocket via 101 Switching Protocols).

(
    req: &L7Request,
    client: &mut C,
    upstream: &mut U,
)

Source from the content-addressed store, hash-verified

355/// Returns the relay outcome indicating whether the connection is reusable,
356/// consumed, or has been upgraded (e.g. WebSocket via 101 Switching Protocols).
357async fn relay_http_request<C, U>(
358 req: &L7Request,
359 client: &mut C,
360 upstream: &mut U,
361) -> Result<RelayOutcome>
362where
363 C: AsyncRead + AsyncWrite + Unpin,
364 U: AsyncRead + AsyncWrite + Unpin,
365{
366 relay_http_request_with_resolver(req, client, upstream, None).await
367}
368
369pub(crate) async fn relay_http_request_with_resolver<C, U>(
370 req: &L7Request,

Callers 1

relayMethod · 0.85

Calls 1

Tested by

no test coverage detected