1

I managed to deploy the WebRTC signaling server (https://github.com/andyet/signalmaster). And there is only one problem remaining For some reason, the connection does not work in Chrome. Chrome throws a warning:

WebSocket connection to '<wss://.......:8888/socket.io/?EIO=3&transport=websocket&sid=-OpElfbpa4_ZAGS9AAAK>' failed: WebSocket is closed before the connection is established.

Hovewer it works fine in Firefox. I set up the SSL certificates. Signaling server is running on EC2. Do you have any thoughts how to fix this?

brmk
  • 250
  • 2
  • 11
  • To get more information try to debug socket.io and see if you can catch why the socket is being closed. You can use: `DEBUG=* node app.js` in server side or `localStorage.debug = '*';` in client side. See more on how to debug in this [link](https://www.tutorialspoint.com/socket.io/socket.io_logging_and_debugging.htm). Update your question if you find something suspicious so we can better help :). – elbecita Oct 06 '17 at 18:38
  • @elbecita here is a pastebin with output on server https://pastebin.com/8YfrBsY4 and the client output http://prntscr.com/gvozyc – brmk Oct 10 '17 at 16:08
  • Don't see anything relevant that helps identifying why the connection is closed. I answered with a few things to try. Let me know if any of them helped. – elbecita Oct 11 '17 at 18:28

1 Answers1

0

A few things to try that might solve the issue:

  • Are socket.io and socket.io-client the same version? If not, you should set them to the same version and try, since a mismatch can cause unstable behavior.

  • Try to modify the ping interval and the pong timeout, to detect if it is due to a timeout in the heartbeats because it takes longer on Chrome. You can do this with:

const io = require('socket.io')(http, {'pingInterval': 5000, 'pingTimeout': 10000});

(This would be 5 seconds interval and 10 seconds timeout, feel free to tweak this and see if it affects somehow).

  • Related to heartbeats check this answer too. Might be that there is no activity in the socket and thus socket.io closes the connection.

  • Another thing to check logs: while you are trying to establish the webrtc connection, open a new tab and go to chrome://webrtc-internals/ and see if you can check what is going on. If there are ICE Candidates, if not, if there is a pair of selected candidates, etc.

I hope some of this information helps.

elbecita
  • 2,616
  • 19
  • 28