summaryrefslogtreecommitdiff
path: root/doc/protocol.md
blob: 3c53a2a350d0e0c7d88fadeccb8312e3f64cc41c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Messages
========

init
----

The streamer-id and tags are optional. All other fields are mandatory. If the streamer-id
is not defined all data-update messages must contain a streamer-id.

{
  "version": 1,
  "hostname": "myhostname",
  "streamer-id": { "content-id": "av-orig", "format": "flash", "quality": "medium" },
  "tags": [ "elevate", "2014", "discourse" ]
}


data-update
-----------

All elements inside data are optional. The update must contain all data gathered between
start-time and start-time + duration-ms.
If defined by the init message the streamer-id is optional as well and when present it's
values override the values of the init message.

{
  "start-time": "2014-08-03T12:34:56.123Z",
  "duration-ms": 5000,
  "streamer-id": { "content-id": "av-orig", "format": "flash", "quality": "medium" },
  "data": {
    "clients": [
       { "ip": "127.0.0.1", "port": 1234, "bytes-sent": 12094, "user-agent": "Mozilla Version 28", .... },
        .....
    ],
    "client-count": 12,
    "bytes-received": 12345,
    "bytes-sent": 921734098,
     ....
  }
}