Rewrite websocket for Lua (Step 9 of ?)