diff --git a/utils.ts b/utils.ts index 7f30dfa..2e40643 100644 --- a/utils.ts +++ b/utils.ts @@ -4,6 +4,7 @@ export const utf8Decoder = new TextDecoder('utf-8') export const utf8Encoder = new TextEncoder() export function normalizeURL(url: string): string { + if (url.indexOf('://') === -1) url = 'wss://' + url let p = new URL(url) p.pathname = p.pathname.replace(/\/+/g, '/') if (p.pathname.endsWith('/')) p.pathname = p.pathname.slice(0, -1)