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

Function ws_tunnel_handler

crates/openshell-server/src/ws_tunnel.rs:42–51  ·  view source on GitHub ↗

Handle the WebSocket upgrade request.

(
    State(state): State<Arc<ServerState>>,
    ws: WebSocketUpgrade,
)

Source from the content-addressed store, hash-verified

40
41/// Handle the WebSocket upgrade request.
42async fn ws_tunnel_handler(
43 State(state): State<Arc<ServerState>>,
44 ws: WebSocketUpgrade,
45) -> impl IntoResponse {
46 ws.on_upgrade(move |socket| async move {
47 if let Err(e) = handle_ws_tunnel(socket, state).await {
48 warn!(error = %e, "WebSocket tunnel connection failed");
49 }
50 })
51}
52
53/// Pipe bytes between the WebSocket and an in-memory `MultiplexService` stream.
54async fn handle_ws_tunnel(

Callers

nothing calls this directly

Calls 1

handle_ws_tunnelFunction · 0.70

Tested by

no test coverage detected