mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
This made testing simple, but enabled insecure behavior. This allows the listener to fetch ICEServers from a remote location, which will likely be coderd.
28 lines
863 B
Protocol Buffer
28 lines
863 B
Protocol Buffer
|
|
syntax = "proto3";
|
|
option go_package = "github.com/coder/coder/peerbroker/proto";
|
|
|
|
package peerbroker;
|
|
|
|
message WebRTCSessionDescription {
|
|
int32 sdp_type = 1;
|
|
string sdp = 2;
|
|
}
|
|
|
|
message Exchange {
|
|
oneof message {
|
|
WebRTCSessionDescription sdp = 1;
|
|
string ice_candidate = 2;
|
|
}
|
|
}
|
|
|
|
// PeerBroker mediates WebRTC connection signaling.
|
|
service PeerBroker {
|
|
// NegotiateConnection establishes a bidirectional stream to negotiate a new WebRTC connection.
|
|
// 1. Client sends WebRTCSessionDescription to the server.
|
|
// 2. Server sends WebRTCSessionDescription to the client, exchanging encryption keys.
|
|
// 3. Client<->Server exchange ICE Candidates to establish a peered connection.
|
|
//
|
|
// See: https://davekilian.com/webrtc-the-hard-way.html
|
|
rpc NegotiateConnection(stream Exchange) returns (stream Exchange);
|
|
} |