Skip to content

Can't create multiple client-side connections to the same server-channel #1

Description

@kdvolder

I was trying to fixup some code that uses multiple SockJS instances to use WebSocketMultiplex instead.

But it seems that there is an built-in assumption that I can not open more than one simultaneous channel with the same name.

I.e.

   var newsChannelForBob = multiplexer.channel('news');
   var newsChannelForAnn = multiplexer.channel('news');

The second call overwrites the first call's instance in 'channels' registry. This leads to problems down the line.

I think that when I write similar code using 'SockJS' directly this works fine and I simply get two independent socket instances each openening a independent websockets connection to the server, connecting to the same websocket url.

If I am correct (not really 100% sure, as not an expert on websockets) then WebSocketMultiplex isn't really what it purports to be. I.e. a transparant replacement for directly using SockJS.

Is this a problem with WebSocketMultiplex? Or is it rather a bug in my understanding / use of the websocket API?

Is there a way to open multiple independent client side channels to the same server-side 'service'?

I would rather avoid implementing my own multiplexer if possible :-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions