Skip to content

Commit 601ade1

Browse files
committed
Update signalling server readme
1 parent ce379b9 commit 601ade1

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

signalling_server/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
# SignallingServer
22

3-
**TODO: Add description**
3+
Simple signalling server for connecting two ICE peers.
44

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.
67

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`:
98

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+
}
1622
```
1723

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.
2125

26+
3. Send any message via WS, it will be forwarded to the other side.

0 commit comments

Comments
 (0)