Y
Y
yankoyski2019-01-27 17:04:55
JavaScript
yankoyski, 2019-01-27 17:04:55

Is it possible to abandon socket.io in favor of ws?

What are the advantages of using socket.io today compared to pure ws?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2019-01-27
@Stalker_RED

Before socket.io was a websocket wrapper that added convenience and fallbacks.
And now... nothing has changed.
Nobody forbids you to abandon this library and write on "native" websockets.

D
de1m, 2019-01-27
@de1m

The upside is that if the client or someone on the path doesn't support websocket, then socket.io can switch to POST and GET. A pure websocket can't do that. I had this when the nginx proxy was crookedly configured and did not support the websocket.
Minus in size, the client needs to download the socket.io library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question