Answer the question
In order to leave comments, you need to log in
Why doesn't socket.io use WebSockets?
When connecting to a socket.io server socket = io.connect('http://url.ru:8080')
on any browser, the connection is established via the polling transport, although all tested browsers fully support WebSocket. Why is this happening?
Console output when connected:
XHR finished loading: GET "http://url.ru:8880/socket.io/?EIO=3&transport=polling&t=L9wWYBs"
XHR finished loading: GET "http://url.ru:8880/socket.io/?EIO=3&transport=polling&t=L9wWYEi&sid=63pyat2zy79oWsoxAAAC"
XHR finished loading: GET "http://url.ru:8880/socket.io/?EIO=3&transport=polling&t=L9wWYZq&sid=63pyat2zy79oWsoxAAAC".
Answer the question
In order to leave comments, you need to log in
Understood.
socket = io.connect('http://url.ru:8080', {transports: ['websocket', 'flashsocket', 'xhr-polling']});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question