MCPcopy Index your code
hub / github.com/simstudioai/sim / isLoopbackIP

Function isLoopbackIP

apps/sim/lib/mcp/domain-check.ts:104–111  ·  view source on GitHub ↗

* Returns true if the IP is a loopback address (full 127.0.0.0/8 range, or ::1).

(ip: string)

Source from the content-addressed store, hash-verified

102 * Returns true if the IP is a loopback address (full 127.0.0.0/8 range, or ::1).
103 */
104function isLoopbackIP(ip: string): boolean {
105 try {
106 if (!ipaddr.isValid(ip)) return false
107 return ipaddr.process(ip).range() === 'loopback'
108 } catch {
109 return false
110 }
111}
112
113/**
114 * Returns true if the hostname is localhost or a loopback IP literal.

Callers 2

isLocalhostHostnameFunction · 0.85
validateMcpServerSsrfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected