И получается, что сейчас использовать socket.io я не могу т.к. она осуществляет транспорт по "псевдо-вэбсокетам" и парни из мобилки не смогут подключиться к моему каналу.
1) "псевдо-вэбсокетам"
мне кажется, что socket.io
использует самые обычные сокеты, просто первое подключение происходит поверх http
, для согласования. В результате согласования выясняется переходить на сокеты (клиент поддерживает их) или остаться на http
(pooling).
2) не смогут подключиться
https://www.npmjs.com/package/socket.io
Some implementations in other languages are also available:
3) если всё же хочется использовать только ws
на сколько я понимаю в приведённом ниже ответе рассказывается как использовать socket.io без http pooling
https://stackoverflow.com/a/28240802/4794368
There are two types of "upgrades" happening with socket.io. First (in socket.io 1.0+), socket.io starts all connections with an http polling request and it may actually exchange some initial data with just an http request. Then, at some point after that, it will try to actually initiate a webSocket connection.
You can prevent the initial http polling entirely by doing this on the client:
var socket = io({transports: ['websocket'], upgrade: false});
This will prevent polling connections from your own cooperating clients. If you want to prevent any clients from ever using polling, then you can add this to the server:
io.set('transports', ['websocket']);
But, if you set this on the server, socket.io clients that are initially connecting with http polling will not work at all. So, this should only be matched with the right settings in the client such that the client never starts with polling.
UPD1:
socket.io/docs
By default, a long-polling connection is established first, then upgraded to “better” transports (like WebSocket).
а тут github.com/socketio/.../transports список протоколов