MCPcopy Index your code
hub / github.com/nodejs/node / isLoopback

Function isLoopback

lib/internal/net.js:90–99  ·  view source on GitHub ↗

* https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml * https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml * https://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml * @param {string

(host)

Source from the content-addressed store, hash-verified

88 * @returns {boolean}
89 */
90function isLoopback(host) {
91 const hostLower = host.toLowerCase();
92
93 return (
94 hostLower === 'localhost' ||
95 hostLower.startsWith('127.') ||
96 hostLower === '[::1]' ||
97 hostLower === '[0:0:0:0:0:0:0:1]'
98 );
99}
100
101module.exports = {
102 kReinitializeHandle: Symbol('kReinitializeHandle'),

Callers 1

inspectorOpenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…