mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-06 15:37:52 +01:00
16 lines
269 B
Erlang
16 lines
269 B
Erlang
|
-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.
|