aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_websocket.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cowboy_websocket.erl b/src/cowboy_websocket.erl
index 693a920..d932323 100644
--- a/src/cowboy_websocket.erl
+++ b/src/cowboy_websocket.erl
@@ -32,6 +32,12 @@
| {module(), Req, any(), timeout()}
| {module(), Req, any(), timeout(), hibernate}
when Req::cowboy_req:req().
+
+-callback websocket_init(Req, State)
+ -> {ok, Req, State}
+ when Req::cowboy_req:req(), State::any().
+-optional_callbacks([websocket_init/2]).
+
-callback websocket_handle({text | binary | ping | pong, binary()}, Req, State)
-> {ok, Req, State}
| {ok, Req, State, hibernate}