Multiple connections failing with Node.js + express + socket.io

I'm trying to develop a a chat application demo that has multiple rooms. Difference here to many Node.js + socket.io demos is that each room is its own process on its own port.

hosts:

  • localhost:8080
  • localhost:8081

THE PROBLEM When my script is set to keep connection to both rooms/hosts simultaneously, connection fails.

  • object for 8080 is created and connecting...
  • object for 8081 is created and connecting...
  • object for 8081 is connected
  • object for 8080 is stuck in xhr-polling

Both rooms/hosts work just fine on their own, but together they fail and no messages can be sent to neither one of them.