title: Can I connect a websocket to a non websocket server
body: <p>I have rust TCP server code:</p>
  <pre class="lang-rust prettyprint-override"><code>fn main() {
      let mut server:  TcpListener = TcpListener::bind(&quot;0.0.0.0:8080&quot;)
          .expect(&quot;[SERVER]: Failed to bind&quot;);
      let mut handler: Handler     = Handler::new();
      
      loop {
          let mut Client = server.accept().unwrap();
          //Handler basically tests if client has send a message and prints that message out
          //the problem is, the client &quot;Connects&quot; server-side, but the websocket client say's it is &quot;connecting&quot;
          handler.newClient(Client.0);
      }
  
  }
  
  </code></pre>
  <p>And I have websocket client code that connects to the server (from the browser):</p>
  <pre class="lang-js prettyprint-override"><code>let ws = new WebSocket(&quot;ws://0.0.0.0:8080&quot;);
  ws.onopen = function(event) {
    ws.send(&quot;Hello, world!&quot;);
  }
  </code></pre>
  <p>Anytime a client connects the server will create a new thread for it and log &quot;Client connected&quot; and also logs anything the client sends.
  When I execute the client script the server Prints out &quot;Client connected&quot; as expected. But it never gets &quot;Hello, world!&quot;, which the client is supposed to send. I am suspecting its because you have to make a actual websocket server. Is there any way to connect a websocket to a non-websocket/socket.io server? Or at least use a different way to connect to a non socket.io/websocket server with js in the browser? Thanks!</p>