Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 1 | namespace aos.web_proxy; |
| 2 | |
| 3 | // SDP is Session Description Protocol. We only handle OFFER (starting a |
| 4 | // transaction) and ANSWER responding to an offer. |
| 5 | enum SdpType : byte { |
| 6 | OFFER, |
| 7 | ANSWER |
| 8 | } |
| 9 | |
| 10 | // The SDP payload is an opaque string that describes what (media/data) we |
| 11 | // want to transmit. |
| 12 | table WebSocketSdp { |
| 13 | type:SdpType; |
| 14 | payload:string; |
| 15 | } |
| 16 | |
| 17 | // ICE is way for different peers to learn how to connect to each other. |
| 18 | // Because we will only be running in a local network, we don't have to support |
| 19 | // advaced features. |
| 20 | table WebSocketIce { |
| 21 | candidate:string; |
| 22 | sdpMid:string; |
| 23 | sdpMLineIndex:int; |
| 24 | } |
| 25 | |
| 26 | union Payload {WebSocketSdp, WebSocketIce} |
| 27 | |
| 28 | // We only send a single type of message on the websocket to simplify parsing. |
| 29 | table WebSocketMessage { |
| 30 | payload:Payload; |
| 31 | } |