title: Nats client connection error with web sockets
body: <p>I am getting problem while connecting the nats.io with web socket ? &quot;failed to reload&quot;, how we can connect with web sockets?
  I think that have SSL issue but not sure about that , I have already tried many times with web sockets and socket.io but didn't get success.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React from "react";
  
  function App() {
  
    React.useEffect(() =&gt; {
      var dummy = new WebSocket("ws://localhost:4222/");
      dummy.onclose = function (e) { 
        console.log("Closed Running")
        console.log(e)
      }
      dummy.onopen = function(e) { console.log("Opened Running")}
      dummy.onmessage = function(e) { console.log(e); };
      // dummy.send("Here's some text that the server is urgently awaiting!");
  
    });
    return (
      &lt;div className="App"&gt;
        &lt;h1&gt;Testing&lt;/h1&gt;
      &lt;/div&gt;
    );
  }
  
  export default App;</code></pre>
  </div>
  </div>
  </p>