socketIO-client icon indicating copy to clipboard operation
socketIO-client copied to clipboard

Support using just the websocket transport

Open taion opened this issue 8 years ago • 15 comments

This works when using the JS client. That client starts off using just the first transport: https://github.com/socketio/engine.io-client/blob/1.8.2/lib/socket.js#L227. There's a few extra LoC to properly set the timeout on the WebSocket transport, but I believe otherwise things work like this.

taion avatar Dec 19 '16 21:12 taion

The motivation here is that we have some Socket.IO servers where we're not using any of the fallback methods, but where (for the moment) the abstraction offered by Socket.IO is valuable enough to justify paying the overhead of Engine.IO, even though we're not getting anything out of it.

We don't want to have to deal with sticky LB sessions, so we only enable the websocket transport.

taion avatar Dec 19 '16 21:12 taion

How does this look?

taion avatar Dec 22 '16 20:12 taion

Following up here. Is there anything I'm missing for this PR?

taion avatar Jan 18 '17 21:01 taion

@invisibleroads Ping!

taion avatar Jan 23 '17 15:01 taion

@taion If I understand correctly, your pull request lets a client connect directly using the websocket transport, bypassing the initial xhr polling. Is that right?

invisibleroads avatar Jan 23 '17 22:01 invisibleroads

That's the idea. This brings things a bit closer to the logic on the Engine.IO JS client side, which doesn't special-case any of the transports on initial connect (it always tries the first listed transport, then negotiates available upgrades with the server).

taion avatar Jan 23 '17 22:01 taion

Any updates here?

taion avatar Feb 02 '17 22:02 taion

Ping.

taion avatar Apr 06 '17 00:04 taion

Any update here? This has been sitting around for a while now. This is a use case that is present in the JS client, and is essentially required when not using sticky sessions on the backend.

taion avatar Apr 17 '17 16:04 taion

What's blocking this PR?

taion avatar Jun 06 '17 14:06 taion

Any updates?

taion avatar Jul 15 '17 01:07 taion

Ping.

taion avatar Jul 25 '17 18:07 taion

@invisibleroads any updates on this?

chirag04 avatar Nov 01 '17 15:11 chirag04

Ping!

taion avatar Nov 15 '17 03:11 taion

@invisibleroads Any update on this PR?

akimul avatar Jun 11 '20 06:06 akimul