From bb7c7dcece26e4ff7de338ca2bf7bc12046edebe Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 18 Dec 2023 01:21:13 -0500 Subject: [PATCH] fix: ensure we are using a ws protocol --- src/methods/registry.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/methods/registry.ts b/src/methods/registry.ts index a08e265..a222951 100644 --- a/src/methods/registry.ts +++ b/src/methods/registry.ts @@ -70,7 +70,9 @@ export async function subscribeToEntry( endpointPath: opts.endpointSubscribeEntry, }); - const socket = new WS(url); + const wsUrl = url.replace(/^http/, "ws"); + + const socket = new WS(wsUrl); socket.once("open", () => { const packer = new Packer();