Rewrite websocket for Lua (Step 8 of ?)