Friday, December 26, 2014

Socket.io from IE8 and IE9

My initial implementation of socket.io worked great with Chrome and Firefox; however, notifications were not being sent to Internet Explorer. The error was:

FlashPolicyFileServer received an error event:listen EADDRINUSE

The solution is in this post https://github.com/Automattic/socket.io/issues/1011 and basically, you need to do this on the server:

io.set('flash policy port', 3300);       //override policy port  
io.set('transports', [                     // enable all transports (optional if you want flashsocket)
    'websocket'
  , 'flashsocket'
  , 'htmlfile'
  , 'xhr-polling'
  , 'jsonp-polling'
]);

and this on the client:

var socket = io.connect(socketAddr,{'flash policy port':3300});