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

Function forward_probe_host

crates/openshell-cli/src/ssh.rs:484–490  ·  view source on GitHub ↗

Resolve the bind address to a connectable host. Wildcard binds (`0.0.0.0`, `::`, empty) are "any-address" listeners, not valid connect targets, so they map to the matching loopback. Specific addresses are probed as-is.

(spec: &ForwardSpec)

Source from the content-addressed store, hash-verified

482/// `::`, empty) are "any-address" listeners, not valid connect targets, so they
483/// map to the matching loopback. Specific addresses are probed as-is.
484fn forward_probe_host(spec: &ForwardSpec) -> &str {
485 match spec.bind_addr.as_str() {
486 "" | "0.0.0.0" => "127.0.0.1",
487 "::" => "::1",
488 host => host,
489 }
490}
491
492/// Best-effort cleanup for the SSH child this process spawned.
493fn terminate_owned_forward_child(child: &mut Child) {

Callers 1

probe_forward_listenerFunction · 0.85

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected