You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lots of searching through docs and web to find how to configure this with not much success, so here is one solution.
Needed to change the flash policy port from the default 10843 (issues with ISP opening ports). I found information on how to run on another port for the server but still kept getting SecurityError on the client.
In this example the node server is running with SSL and is only used for socket.io communication (not feeding up any HTML). The flash policy port has been reconfigured to also listen on port 3300
SERVER
varfs=require('fs');varoptions={key: fs.readFileSync('/etc/ssl/ebscerts/wildcard.my_example.com.no_pass.key'),cert: fs.readFileSync('/etc/ssl/ebscerts/wildcard.my_example.com.crt'),ca: fs.readFileSync('/etc/ssl/ebscerts/bundle.crt')};varapp=require('https').createServer(options,handler),io=require('socket.io').listen(app);app.listen(3300);//for testingfunctionhandler(req,res){res.writeHead(200);res.end("welcome to ebidnsave\n");}//production settingsio.enable('browser client minification');// send minified clientio.enable('browser client etag');// apply etag caching logic based on version numberio.enable('browser client gzip');// gzip the fileio.set('log level',1);// reduce logging//io.set('match origin protocol', 'true');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']);
Finally realized the client also has to be overridden. This can be done by passing the 'flash policy port' on the io.connect call.
CLIENT
//socketAddr is server uri ex. https://ww2.my_example.com:3300varsocket=io.connect(socketAddr,{'flash policy port':3300});socket.on('connect',function(){ .....
The above works with IE9 (seems to work with IE8 with a quick test). BUT there is still a delay in setting up the socket which I think is due to flashsocket trying port 843 first.
Socket.io.client documentation lists some of the options that can be configured but does not mention 'flash policy port'.
In digging through the file I found on line 1512 of 0.9.10 this list of options that if passed are merged in and override defaults. Not recommending others be changed.
Hi @ADumaine, I followed the steps you suggest but the browser warns me of the following:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://domain.dev:3300/socket.io/1/?t=1422538971224. This can be fixed by moving the resource to the same domain or enabling CORS.
Lots of searching through docs and web to find how to configure this with not much success, so here is one solution.
Needed to change the flash policy port from the default 10843 (issues with ISP opening ports). I found information on how to run on another port for the server but still kept getting SecurityError on the client.
In this example the node server is running with SSL and is only used for socket.io communication (not feeding up any HTML). The flash policy port has been reconfigured to also listen on port 3300
SERVER
Finally realized the client also has to be overridden. This can be done by passing the 'flash policy port' on the io.connect call.
CLIENT
The above works with IE9 (seems to work with IE8 with a quick test). BUT there is still a delay in setting up the socket which I think is due to flashsocket trying port 843 first.
Socket.io.client documentation lists some of the options that can be configured but does not mention 'flash policy port'.
In digging through the file I found on line 1512 of 0.9.10 this list of options that if passed are merged in and override defaults. Not recommending others be changed.
It would be nice if this could be added to both socket.io and socket.io.client documentation. Hopes this helps...
The text was updated successfully, but these errors were encountered: