I have been struggling with this for some days now, trying to find information everywhere but I couldn't solve it.
Basically, I have a flash client app and a browser - chrome based app connected to a socket io - nodejs serve instance.
As you know, Chrome works over websockets and my flash app works over flash sockets.
Everything works well between chrome and node, but when I make any interaction from my flash app, that degrades the connection type to flash sockets instead of websockets making the chrome web app unable to read from the server, as the server starts to emit messages using flashsockets. Basically, when I do any interaction from flash, chrome doesn't receive any info any more.
Do you know any way to keep serving info via flash - node in flashsockets but also guarantee that node - chrome communicates via websockets?
I have tried the recommended library for connectivity with socket io that you can find in the socket io website; it is this one https://github.com/simb/FlashSocket.IO
Also I have tried to use a library in AS3 that uses websockets, but seems uncapable of communicating properly with socket.io; it is this one https://github.com/y8/websocket-as . The message socket io outputs when trying to connect is "debug - destroying non-socket.io upgrade"
Some debug code here, showing flashsockets and websocket, this is, my two client apps trying to connect to the same socket io server:
https://gist.github.com/4637617
Thanks a lot for your help!
if you configure socket.io with multiple transports, when a client connects, it will pick the best available transport. So if one client can only use flash, that's what it will use, while an other might use xhr-polling.
by default, you have websocket, htmlfile, xhr-polling, jsonp-polling, but not flashsocket.
see https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO for more details.
Thanks, finally after a lot of work, I have managed to solve the problem.
Socket.io has a very smart implementation that allows you to use namespaces and rooms.
I have solved it by working in two different namespaces: one for the browsers and another for flash.
Example:
Flash sends "click" when I click a button and then I send a message to all the browsers in the browser namespace.
Pretty useful.
I hope this helps someone!
All the best