Websockets! Why not let the browser just make regular TCP connections? It does do that Not from javascript, or other in-page scripts Websockets are pretty much like TCP, except: 1. They're started with HTTP upgrade 2. They include message length 3. Messages from the client are masked Note: With https, browser won't allow regular websocket My demo uses regular websockets Header format It can be pretty small, or bigger than that Opcodes Binary, not like HTTP Example! Javascript in the browser This part is pretty simple in my example You can write less simple javascript too Server: Adapted from a proxy server It's a complete mess really