aboutsummaryrefslogtreecommitdiffstats
path: root/test/websocket_handler.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/websocket_handler.erl')
-rw-r--r--test/websocket_handler.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/websocket_handler.erl b/test/websocket_handler.erl
index d06bfee..4ba2a67 100644
--- a/test/websocket_handler.erl
+++ b/test/websocket_handler.erl
@@ -20,12 +20,14 @@ websocket_init(_TransportName, Req, _Opts) ->
erlang:start_timer(1000, self(), <<"websocket_init">>),
{ok, Req, undefined}.
-websocket_handle(Data, Req, State) ->
- {reply, Data, Req, State}.
+websocket_handle({text, Data}, Req, State) ->
+ {reply, {text, Data}, Req, State};
+websocket_handle(_Frame, Req, State) ->
+ {ok, Req, State}.
websocket_info({timeout, _Ref, Msg}, Req, State) ->
erlang:start_timer(1000, self(), <<"websocket_handle">>),
- {reply, Msg, Req, State};
+ {reply, {text, Msg}, Req, State};
websocket_info(_Info, Req, State) ->
{ok, Req, State}.