P
P
prebionix2016-07-13 13:13:04
JavaScript
prebionix, 2016-07-13 13:13:04

Why doesn't socket.io work in Chrome?

Google Chrome can't connect to Node.js server, script doesn't work. Checked in Firefox, Internet Explorer, everything works as it should. Here is the connection code:

if (navigator.userAgent.toLowerCase().indexOf('chrome') != -1) {
     socket = io.connect('http://*.*.*.*:8585', {'transports': ['xhr-polling']});
} else {
     socket = io.connect('http://*.*.*.*:8585');
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Kondratiev, 2016-07-13
@prebionix

try not to specify transports for chrome)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question