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

Function classify_connection_protocol

crates/openshell-server/src/lib.rs:570–574  ·  view source on GitHub ↗
(stream: &TcpStream)

Source from the content-addressed store, hash-verified

568}
569
570async fn classify_connection_protocol(stream: &TcpStream) -> std::io::Result<ConnectionProtocol> {
571 let mut prefix = [0_u8; 8];
572 let read = stream.peek(&mut prefix).await?;
573 Ok(classify_initial_bytes(&prefix[..read]))
574}
575
576fn classify_initial_bytes(prefix: &[u8]) -> ConnectionProtocol {
577 if looks_like_tls(prefix) {

Callers 1

spawn_gateway_connectionFunction · 0.85

Calls 1

classify_initial_bytesFunction · 0.85

Tested by

no test coverage detected