Two computers, one connects the channel successfully, one does not

I have two computers connecting to a phoenix server. The Js that are served for both are identical. Both versions run on the same version of Chrome. One is windows, the other is OSX.

The OSX computer is behaving correctly. However, the Windows computer never gets "ok" back to the chan.join () call.

let socket = new Socket('ws://testapi.com:4000/socket', opts);
socket.connect();
let chan = socket.channel('rooms:' + room);
chan.join()
  .receive("ok", ({messages}) => console.log("catching up", messages) )
  .receive("error", ({reason}) => console.log("failed join", reason) )
  .receive("timeout", () => console.log("Networking issue. Still waiting..."));

After a few seconds, the Windows computer will display a timeout message. In network activity, I see that the websocket connection is running, and the only traffic on it is:

{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":"1"}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":"2"}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":"3"}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":null}
{"topic":"rooms:test","event":"phx_join","payload":{}, "ref":"4"}

and etc.

I was unable to get any hints from any of the server logs. Errors do not occur.

+4
source share

Source: https://habr.com/ru/post/1654192/


All Articles