I am trying to connect to the server on port 77 using this code:

<script> alert("start!"); var exampleSocket = new WebSocket("ws://192.168.1.190/77"); alert(exampleSocket.readyState); </script> 

It turns out first start, and then 0. I try this:

  <script> alert("start!"); var exampleSocket = new WebSocket("ws://192.168.1.190:77"); alert(exampleSocket.readyState); </script> 

It turns out only start. Simultaneously with the execution of the script, I look at the server output, there are no connection reports, the server part is exactly working.

  • one
    wrap the last alert in a set-timeout, for a couple of seconds - Dmytryk
  • How to do it? - Kirill Nikiforov
  • one
    setTimeout(function(){alert(exampleSocket.readyState) },2000) - Dmytryk
  • Nothing has changed, there is also no alert, and there is no connection to the server either. - Kirill Nikiforov
  • one
    try to change the port - Dmytryk

0