MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / isLoopbackBind

Function isLoopbackBind

scripts/bind-host.mjs:13–20  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

11const IPV4_LOOPBACK_RE = /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
12
13export function isLoopbackBind(host) {
14 if (host == null || host === "") return false;
15 const normalized = String(host)
16 .trim()
17 .replace(/^\[|\]$/g, "")
18 .toLowerCase();
19 return STATIC_LOOPBACK_HOSTS.has(normalized) || IPV4_LOOPBACK_RE.test(normalized);
20}
21
22/**
23 * Resolve the listen address.

Callers 5

buildConfigFunction · 0.90
mountMarsWebBridgeFunction · 0.90
isForeignHostFunction · 0.90
bind-host.test.tsFile · 0.90
applySessionKeyPolicyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected