I am trying to check fallback for polling in socket.io to make sure my application works with clients that do not support websites for any reason.
I use a very basic server / client example for Express 4. It works fine with:
// client-side var options = { transports: [ 'xhr-polling', 'websocket' ] }; var socket = io.connect('http://localhost:8080', options); socket.on('news', function (data) { console.log(data); socket.emit('my other event', { my: 'data' }); });
However, if I remove the "websocket" from the transport, nothing happens on the client side - there is no error, no events, nothing. On the server side, I see only:
Tue, 03 Mar 2015 16:45:49 GMT socket.io:server serve client 304
George Armhold Mar 03 '15 at 16:59 2015-03-03 16:59
source share