Rewrite websocket for Lua (Step 11 of ?)