25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-06 15:37:52 +01:00
xmpp.chapril.org-ejabberd/src/web/websocket_test.erl

16 lines
269 B
Erlang
Raw Normal View History

-module (websocket_test).
-export([handle/1]).
% callback on received websockets data
handle(Ws) ->
receive
{browser, Data} ->
Ws:send(["received '", Data, "'"]),
handle(Ws);
_Ignore ->
handle(Ws)
after 5000 ->
Ws:send("pushing!"),
handle(Ws)
end.