File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change 1
1
# SignallingServer
2
2
3
- ** TODO: Add description **
3
+ Simple signalling server for connecting two ICE peers.
4
4
5
- ## Installation
5
+ It creates a single room where only two peers can join.
6
+ Every message sent by one peer will be forwarded to the other peer.
6
7
7
- If [ available in Hex] ( https://hex.pm/docs/publish ) , the package can be installed
8
- by adding ` signalling_server ` to your list of dependencies in ` mix.exs ` :
9
8
10
- ``` elixir
11
- def deps do
12
- [
13
- {:signalling_server , " ~> 0.1.0" }
14
- ]
15
- end
9
+ 1 . Connect as
10
+
11
+ ``` js
12
+ sock = new WebSocket (" ws://localhost:4000/websocket" )
13
+ ```
14
+
15
+ 2 . When the other peer connects, the signalling server sends simple info JSON:
16
+
17
+ ``` json
18
+ {
19
+ "type" : " peer_joined" ,
20
+ "role" : " controlled"
21
+ }
16
22
```
17
23
18
- Documentation can be generated with [ ExDoc] ( https://github.com/elixir-lang/ex_doc )
19
- and published on [ HexDocs] ( https://hexdocs.pm ) . Once published, the docs can
20
- be found at < https://hexdocs.pm/signalling_server > .
24
+ The ` role ` field is a role a peer that received info JSON should use to avoid role conflict.
21
25
26
+ 3 . Send any message via WS, it will be forwarded to the other side.
You can’t perform that action at this time.
0 commit comments