Rewrite websocket for Lua (Step 7 of ?)