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

Method serve_service_http

crates/openshell-server/src/multiplex.rs:207–223  ·  view source on GitHub ↗

Serve a plaintext HTTP connection for sandbox service endpoints only.

(
        &self,
        stream: S,
    )

Source from the content-addressed store, hash-verified

205
206 /// Serve a plaintext HTTP connection for sandbox service endpoints only.
207 pub async fn serve_service_http<S>(
208 &self,
209 stream: S,
210 ) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
211 where
212 S: AsyncRead + AsyncWrite + Unpin + Send + 'static,
213 {
214 let http_service = TowerToHyperService::new(request_id_middleware!(service_http_router(
215 self.state.clone()
216 )));
217
218 Builder::new(TokioExecutor::new())
219 .serve_connection_with_upgrades(TokioIo::new(stream), http_service)
220 .await?;
221
222 Ok(())
223 }
224}
225
226#[derive(Clone, Debug)]

Callers 1

spawn_gateway_connectionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected