diff --git a/src/index.ts b/src/index.ts index 993642a..5274f19 100644 --- a/src/index.ts +++ b/src/index.ts @@ -464,14 +464,7 @@ async function createProtomuxChannel(aq: ActiveQuery) { }; }; - aq.setReceiveUpdate?.((data: any) => { - switch (data.action) { - case "open": - channel.open(); - } - }); - - const channel = mux.createChannel({ + let channel = mux.createChannel({ protocol: data?.protocol, id: data?.id, handshake: data?.handshake, @@ -485,6 +478,8 @@ async function createProtomuxChannel(aq: ActiveQuery) { return; } + channel.open(); + const channelId = getChannelId(); connections.get(aq.callerInput.id)?.channels.set(channelId, channel);