MCPcopy
hub / github.com/coder/mux / isLoopbackHost

Function isLoopbackHost

src/node/services/serverService.ts:59–68  ·  view source on GitHub ↗
(host: string)

Source from the content-addressed store, hash-verified

57const TAILSCALE_IP_COMMAND_TIMEOUT_MS = 1_000;
58
59function isLoopbackHost(host: string): boolean {
60 const normalized = host.trim().toLowerCase();
61
62 // IPv4 loopback range (RFC 1122): 127.0.0.0/8
63 if (normalized.startsWith("127.")) {
64 return true;
65 }
66
67 return normalized === "localhost" || normalized === "::1";
68}
69
70function formatHostForUrl(host: string): string {
71 const trimmed = host.trim();

Callers 2

computeNetworkBaseUrlsFunction · 0.70
startServerMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected