title: Why do I get HTTP request when using WebSockets?
body: <p>I've written a vanilla WebSocket client in JavaScript that connects to a localhost via 8080 port and sends out '<strong><em>hello server</em></strong>'.</p>
  
  <p>My server is witten in Python using standart <strong>socket</strong> package. When I connect to it using <code>WebSocket</code>, the server receives a HTTP request:</p>
  
  <pre><code>GET / HTTP/1.1
  Upgrade: websocket
  Connection: Upgrade
  Host: 127.0.0.1:8080
  Origin: http://127.0.0.1:3030
  Pragma: no-cache
  Cache-Control: no-cache
  Sec-WebSocket-Key: g3y2hDw5WpZYKUwIrsGYaw==
  Sec-WebSocket-Version: 13
  Sec-WebSocket-Extensions: x-webkit-deflate-frame
  </code></pre>
  
  <p>... and it doesn't receive the original <strong><em>'hello server'</em></strong> message that was supposed to be sent by the <code>WebSocket</code> connection.</p>
  
  <p>I'm confused; are regular sockets and WebSockets not the same thing? Why do I get HTTP request instead of original message?</p>