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

Function grpc_server_from_ssh_gateway_url

crates/openshell-cli/src/ssh.rs:1399–1412  ·  view source on GitHub ↗
(gateway_url: &str)

Source from the content-addressed store, hash-verified

1397}
1398
1399fn grpc_server_from_ssh_gateway_url(gateway_url: &str) -> Result<String> {
1400 let url: url::Url = gateway_url
1401 .parse()
1402 .into_diagnostic()
1403 .wrap_err("invalid gateway URL")?;
1404 let scheme = url.scheme();
1405 let gateway_host = url
1406 .host_str()
1407 .ok_or_else(|| miette::miette!("gateway URL missing host"))?;
1408 let gateway_port = url
1409 .port_or_known_default()
1410 .ok_or_else(|| miette::miette!("gateway URL missing port"))?;
1411 Ok(format_gateway_url(scheme, gateway_host, gateway_port))
1412}
1413
1414/// Run the SSH proxy in "name mode": create a session on the fly, then proxy.
1415///

Callers 1

sandbox_ssh_proxyFunction · 0.85

Calls 2

format_gateway_urlFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected