summaryrefslogtreecommitdiff
path: root/REST-API
blob: 9fe6dcfb1dfcb73f8caf2e00c8c7d661ca895bb0 (plain)
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
41
42
43
44
45
46
47
48
49
The server now implements two REST APIs:

1) A token-based validation API for clients that want to stream
2) A simple API to list or abort streams running on the server


Token-based Validation:
=======================

The server maintains a hash table of (sessionid, udp-host, udp-port) tuples
against which incoming (HTTP PUT/POST) and outgoing (HTTP GET) streams are
validated. The following API is available to manipulate this table:

Adding Tokens:
--------------

> Adding a token for an HTTP stream
    POST http://[host]:8000/api/add-token?type=http&sessionid=[sessionid]

> Adding a token for an RTP-UDP stream on host:port
    POST http://[host]:8000/api/add-token?type=rtp-udp&sessionid=[sessionid]&udp-clients=[host]:[port]

> Adding a token for an HTTP stream and RTP-UDP streams on host1:port1,host2:port2
    POST http://[host]:8000/api/add-token?type=http,rtp-udp&sessionid=[sessionid]&udp-clients=[host1]:[port1],[host2]:[port2]

Revoking Tokens:
----------------

> Revoking a token
    DELETE http://[host]:8000/api/revoke-token?sessionid=[sessionid]

Listing Tokens:
----------------

> Listing all tokens
    GET http://[host]:8000/api/list-tokens

This will return a JSON array of dicts with the "sessionid", "host", and "port"
for each token.


Listing and Aborting Running Streams:
=====================================

> Listing all streams
    GET http://[host]:8000/api/list-streams

> Aborting a running stream
    DELETE http://[host]:8000/api/abort-stream?sessionid=[sessionid]