export const isValidEndpointUrl = (url: string): boolean => { try { const parsed = new URL(url); if (parsed.protocol === "https:") { return true; } else if ( parsed.protocol === "http:" && (parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1") ) { return true; } return false; } catch { return false; } };