38
38
39
39
-type payload () :: binary () | iolist ().
40
40
41
- -type message () ::
42
- {text , payload ()} |
43
- {binary , payload ()} |
44
- {ping , payload ()} |
45
- {pong , payload ()}.
41
+ -type message () :: {text , payload ()} |
42
+ {binary , payload ()} |
43
+ {ping , payload ()} |
44
+ {pong , payload ()}.
46
45
47
- -type event () ::
48
- websocket_open | websocket_close |
49
- websocket_throw | websocket_error | websocket_exit .
46
+ -type event () ::
47
+ websocket_open | websocket_close |
48
+ websocket_throw | websocket_error | websocket_exit .
50
49
51
50
52
- % Args: proplist with settings.
53
- % handler: Websocket callback module
54
- % handler_opts: Options to pass to the websocket_init
55
- % callback.
56
- % resp_compress: bool(), when set to true the traffic
57
- % will be compressed if the client supports it.
58
- %
51
+ % % Args: proplist with settings.
52
+ % % handler: Websocket callback module
53
+ % % handler_opts: Options to pass to the websocket_init
54
+ % % callback.
55
+ % % resp_compress: bool(), when set to true the traffic
56
+ % % will be compressed if the client supports it.
57
+ % %
59
58
60
- % @doc Upgrade the request to a websocket, will respond with
61
- % bad request when something is wrong.
59
+ % % @doc Upgrade the request to a websocket, will respond with
60
+ % % bad request when something is wrong.
62
61
-spec upgrade (Req :: elli :req (), list ()) -> ok .
63
62
upgrade (Req , Args ) ->
64
63
RespCompress = proplists :get_value (resp_compress , Args , false ),
@@ -69,4 +68,3 @@ upgrade(Req, Args) ->
69
68
% % Adapter is ready, hand over to ws_protocol
70
69
_UpgradeResponse = elli_ws_protocol :upgrade (ReqAdapter , Args , Handler , HandlerOpts ),
71
70
ok .
72
-
0 commit comments