title: How to debug websocket connection error with "Unknown reason"
body: <p>Recently, I am getting the following message on chrome console;</p>
  
  <pre><code>WebSocket connection to 'ws://evo15:4008/?stream' failed: Unknown reason
  </code></pre>
  
  <p>It's getting more and more and it's somehow annoying and I have to open a new tab or restart chrome every time to get back to normal websocket connection. How can I debug it? Unfortunately, I cannot reproduce it yet. My chrome version is <code>Version 77.0.3865.75 (Official Build) (64-bit)</code></p>
  
  <p><strong>Update 1</strong>: I think you could reproduce it by closing the connection for a long time (I don't know the exact time) from server side and then open it and try to connect to it (client trys to connect every 1 sec). Then it will happen. So I guess there is an expire time or a limited number of tries to connect somewhere.</p>
  
  <p><strong>Update 2</strong>: It happens after 256 tries of reconnection.</p>
  
  <pre><code>WebSocket connection to 'ws://evo15:4008/?stream' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>After seeing 255 of this error on console, you will see the first error and cannot reconnect. So I think there is a 8 bit limit somewhere that I am missing</p>
  
  <p><a href="https://i.stack.imgur.com/pLgQY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pLgQY.png" alt="enter image description here"></a></p>