1
- Elli Websocket Handler
2
- ======================
1
+ # elli_websocket
2
+
3
+ * A WebSocket handler for [ Elli] ( https://github.com/elli-lib/elli ) *
3
4
4
- elli_websocket is a websocket handler for Elli: https://github.com/knutin/elli
5
5
6
6
## Installation
7
7
8
- You can add elli_websocket to your application by adding it as a dependency to your elli
8
+ You can add ` elli_websocket ` to your application by adding it as a dependency to your elli
9
9
application.
10
10
11
11
``` erlang
12
- % rebar.config
13
12
{deps , [
14
- {elli , " .*" , {git , " git://github.com/mmzeeman/elli.git" , {branch , " ssl+handover" }}},
15
- {elli_websocket , " .*" , {git , " git://github.com/mmzeeman/elli_websocket.git" , {branch , " master" }}},
16
- % ...
13
+ {elli_websocket , " .*" , {git , " git://github.com/elli-lib/elli_websocket.git" , {branch , " master" }}}
17
14
]}.
18
15
```
19
16
20
- Afterwards you can run:
21
-
22
- ``` sh
23
- $ ./rebar get-deps
24
- $ ./rebar compile
25
- ```
26
-
27
17
28
- ## Callback module
18
+ ## Callback Module
29
19
30
- See elli_example_websocket.erl for details.
20
+ See [ elli_example_websocket.erl] ( ./src/elli_example_websocket.erl ) for details.
31
21
32
22
``` erlang
33
23
-module (elli_echo_websocket_handler ).
@@ -49,15 +39,14 @@ websocket_info(Req, Message, State) ->
49
39
50
40
websocket_handle_event (Name , EventArgs , State ) ->
51
41
ok .
52
-
53
42
```
54
43
55
- ## Upgrading to Websocket Connection
56
44
57
- This is an example of how you can upgrade to a websocket connection.
45
+ ## Upgrading to WebSocket Connection
58
46
59
- ``` erlang
47
+ This is an example of how you can upgrade to a WebSocket connection.
60
48
49
+ ``` erlang
61
50
-module (elli_echo_websocket ).
62
51
63
52
-export ([init /2 , handle /2 , handle_event /3 ]).
@@ -109,7 +98,3 @@ handle('GET', [<<"echo_websocket">>], _Req, _Args) ->
109
98
handle (_ ,_ ,_ ,_ ) ->
110
99
ignore .
111
100
```
112
-
113
-
114
-
115
-
0 commit comments