forked from bengreenier/webrtc-signal-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yml
134 lines (134 loc) · 4.68 KB
/
swagger.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
swagger: '2.0'
info:
description: "opinionated webrtc signal provider using `http` as a protocol
\n
![logo
gif](https://github.com/bengreenier/webrtc-signal-http/raw/master/readme_example.gif)
\n\n
We needed a simple to use, easy to extend [WebRTC](https://webrtc.org/)
signaling server that communicated over regular old `HTTP/1.1` for
[3dtoolkit](https://github.com/catalystcode/3dtoolkit) - this is it. It's
designed to mirror [the WebRTC example
server](https://github.com/svn2github/webrtc/tree/master/talk/examples/peerconnection/server)
at an API level, while allowing developers to consume and extend the base
functionality."
version: 1.0.0
title: webrtc-signal-http
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'
schemes:
- http
paths:
/sign_in:
get:
summary: Indicates a peer is available to peer with
description: >-
Indicates a peer is available to peer with. The response will contain
the unique peer_id assigned to the caller in the `Pragma` header, and a
`csv` formatted list of peers in the `body`.
operationId: addPeer
produces:
- text/plain
parameters:
- name: peer_name
in: query
description: >-
a friendly description of the client for user identification
purposes
required: true
type: string
responses:
'200':
description: successful response
schema:
$ref: '#/definitions/PeerList'
'400':
description: missing peer_name
/sign_out:
get:
summary: Indicates a peer is no longer available to peer with
description: >-
Indicates a peer is no longer available to peer with. It is expected
this method be called when a peer is no longer intending to use
signaling. The response will be empty.
operationId: removePeer
parameters:
- in: query
name: peer_id
description: the unique id of the client
required: true
type: string
responses:
'200':
description: successful response
schema:
$ref: '#/definitions/PeerList'
'400':
description: invalid peer_name
/wait:
get:
summary: >-
Provides a mechanism for simulated server push, using vanilla http long
polling
description: >-
Provides a mechanism for simulated server push, using vanilla http long
polling. That is, the TCP socket behind this request will remain open to
the server until there is content the server needs to send. In the event
of a TCP timeout the client should reconnect. Messages that contain a
`Pragma` value that matches the client `peer_id` are peer status updates
and should be handled the same as the status update provided in the `GET
/sign_in` response. `Content-Type` headers will not reflect the type of
the original content.
operationId: setPeerSocket
parameters:
- in: query
name: peer_id
description: the unique id of the client
required: true
type: string
responses:
'200':
description: successful response
schema:
$ref: '#/definitions/PeerList'
'400':
description: invalid peer_name
/message:
post:
summary: Provides a messaging mechanism for one peer to send data to another
description: >-
Provides a messaging mechanism for one peer to send data to another.
There are no requirements around the type of data that can be sent. The
message may be buffered until the receiving peer connects to the
service. The response will be empty.
operationId: sendMessage
parameters:
- in: query
name: peer_id
description: the unique id of the client
required: true
type: string
- in: query
name: to
description: the unique id of the peer we wish to send data to
required: true
type: string
responses:
'200':
description: successful response
schema:
$ref: '#/definitions/PeerList'
'400':
description: invalid peer_name
definitions:
PeerList:
type: string
description: >-
csv representation of a collection of peers. Each line indicates the peer
name, the peer id, and a 1 or a 0 representing the connection status of
the peer
example: 'testPeer,1,1\notherPeer,2,1\nthirdPeer,3,0'
externalDocs:
description: Find out more on Github
url: 'https://github.com/bengreenier/webrtc-signal-http'