const LOCAL_HOSTNAMES = new Set([
    'localhost',
    '127.0.0.1',
    '0.0.0.0',
    '[::1]',
    '::1',
]);
/**
 * Check if a URL points to a local server.
 * Matches: localhost, 127.0.0.1, 0.0.0.0, ::1
 */
export function isLocalURL(url) {
    try {
        const parsed = new URL(url);
        if (parsed.hostname) {
            return LOCAL_HOSTNAMES.has(parsed.hostname);
        }
    }
    catch {
        // Fall through to string matching
    }
    // Fallback for malformed URLs or empty hostname: check the raw string
    return (url.includes('localhost') ||
        url.includes('127.0.0.1') ||
        url.includes('0.0.0.0') ||
        url.includes('::1'));
}
//# sourceMappingURL=url-utils.js.map