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

Function find_forward_by_port

crates/openshell-core/src/forward.rs:398–403  ·  view source on GitHub ↗

Find the live, validated forward owner for a local port.

(port: u16)

Source from the content-addressed store, hash-verified

396
397/// Find the live, validated forward owner for a local port.
398pub fn find_forward_by_port(port: u16) -> Result<Option<String>> {
399 Ok(list_forwards()?
400 .into_iter()
401 .find(|forward| forward.port == port && forward.validated_alive)
402 .map(|forward| forward.sandbox_name))
403}
404
405/// Stop a background port forward.
406pub fn stop_forward(name: &str, port: u16) -> Result<bool> {

Callers 1

mainFunction · 0.85

Calls 1

list_forwardsFunction · 0.85

Tested by

no test coverage detected