WebSocket emulation - Erlang server (UPDATED to work with cowboy 0.8)