A strange error...

I am having issues using express as the server for node.js:
"?colyseusid=" keeps getting appended to the url and Firefox complains.
Firefox can’t establish a connection to the server at ws://localhost:3000/?colyseusid=.

Hi @Project-Magenta, are you sure the server is running on port 3000?

Hi guys, I'm having the same issue and it's only in FF:

Firefox can’t establish a connection to the server at ws://192.168.33.77:8080/?colyseusid=JWr9PJf4t.
colyseus.js:693:51
Firefox can’t establish a connection to the server at ws://192.168.33.77:8080/SQRRPk2PZE?colyseusid=JWr9PJf4t&requestId=1. colyseus.js:693:51
Possible causes: room's onAuth() failed or maxClients has been reached. colyseus.js:2967:13

if I open the same page in Chrome everything works fine, below you can see the movements, but when I try with FF you can see a onDispose is "automatically" happening:

GameRoom received message from YLv3kAiNLO : { x: 1 }
GameRoom received message from YLv3kAiNLO : { x: 1 }
GameRoom received message from YLv3kAiNLO : { x: 1 }
GameRoom received message from YLv3kAiNLO : { x: 1 }
GameRoom received message from YLv3kAiNLO : { x: 1 }
GameRoom received message from YLv3kAiNLO : { x: 1 }
GameRoom received message from YLv3kAiNLO : { x: 1 }
GameRoom received message from YLv3kAiNLO : { x: 1 }
Dispose GameRoom
GameRoom created! { requestId: 1, clientId: 'JWr9PJf4t', sessionId: 'I6M20a_D7' }
Dispose GameRoom

Same code was working a few hours ago.
Any clues?

After a few FF restarts it started to work without modified a single line.
The same happens with IE.
Still not a clue about what caused the issue :(

OK! FINALLY FOUND THE ISSUE!

The short-temporal-fix:
1 - Open FF and go to about:config
2 - Look for network.websocket.max-connections
3 - Set the number as high as you like :P at some point you will probably hit the issue again.

The long-story:

  • Doing some research found the following: http://websocketstest.com/
    In my case websockets in FF were mark as supported but every port seems to be closed and not a single connection was stablished. In CH everything is opened and working.
  • At this point I've realized that for sure it was something in the client and I've started to think in a weird case where FF is reaching a limit in the WebSocket connections. Didn't know this was possible....
  • Keep doing some research on the issue and found a post that says something like: "https:// to ws:// is disallowed by default on firefox", in the same thread says that could be fixed by going to firefox's about:config and toggling network.websocket.allowInsecureFromHTTPS but didn't worked for me.
  • So I've started to do some tests by changing the FF configurations, first tried by changing other configs like "network.websocket.delay-failed-reconnects" but didn't worked. And there it was! "network.websocket.max-connections" had a 200 value, so I've changed it to 201, and after refresh the App it finally worked. There are also other configurations there like "network.websocket.timeout.close", but I really don't want to change any of these to fix the issue (not even the max-connections value), because I don't think that's a fix but more of a hack to avoid the issue.

Now... the real issue seems to be that FF is keeping all the connections opened after you refresh the browser.
One thing to note is that even FF keep the "connection" as "active", the colyseus monitor show up how the user connects and disconnects.
An easy way to test this is by connecting to any app open the config in a new tab and set the connections limit to 2, then refresh the browser y after the second refresh you won't be able to connect anymore.
I'll be still digging on this to find a final fix but maybe is just something I'm setting in my app?
I'm using the very simple "state" case from the colyseus-examples.
@endel any clues?

Thanks in advance!