configuration.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //go:build !js
  2. // +build !js
  3. package webrtc
  4. // A Configuration defines how peer-to-peer communication via PeerConnection
  5. // is established or re-established.
  6. // Configurations may be set up once and reused across multiple connections.
  7. // Configurations are treated as readonly. As long as they are unmodified,
  8. // they are safe for concurrent use.
  9. type Configuration struct {
  10. // ICEServers defines a slice describing servers available to be used by
  11. // ICE, such as STUN and TURN servers.
  12. ICEServers []ICEServer `json:"iceServers,omitempty"`
  13. // ICETransportPolicy indicates which candidates the ICEAgent is allowed
  14. // to use.
  15. ICETransportPolicy ICETransportPolicy `json:"iceTransportPolicy,omitempty"`
  16. // BundlePolicy indicates which media-bundling policy to use when gathering
  17. // ICE candidates.
  18. BundlePolicy BundlePolicy `json:"bundlePolicy,omitempty"`
  19. // RTCPMuxPolicy indicates which rtcp-mux policy to use when gathering ICE
  20. // candidates.
  21. RTCPMuxPolicy RTCPMuxPolicy `json:"rtcpMuxPolicy,omitempty"`
  22. // PeerIdentity sets the target peer identity for the PeerConnection.
  23. // The PeerConnection will not establish a connection to a remote peer
  24. // unless it can be successfully authenticated with the provided name.
  25. PeerIdentity string `json:"peerIdentity,omitempty"`
  26. // Certificates describes a set of certificates that the PeerConnection
  27. // uses to authenticate. Valid values for this parameter are created
  28. // through calls to the GenerateCertificate function. Although any given
  29. // DTLS connection will use only one certificate, this attribute allows the
  30. // caller to provide multiple certificates that support different
  31. // algorithms. The final certificate will be selected based on the DTLS
  32. // handshake, which establishes which certificates are allowed. The
  33. // PeerConnection implementation selects which of the certificates is
  34. // used for a given connection; how certificates are selected is outside
  35. // the scope of this specification. If this value is absent, then a default
  36. // set of certificates is generated for each PeerConnection instance.
  37. Certificates []Certificate `json:"certificates,omitempty"`
  38. // ICECandidatePoolSize describes the size of the prefetched ICE pool.
  39. ICECandidatePoolSize uint8 `json:"iceCandidatePoolSize,omitempty"`
  40. // SDPSemantics controls the type of SDP offers accepted by and
  41. // SDP answers generated by the PeerConnection.
  42. SDPSemantics SDPSemantics `json:"sdpSemantics,omitempty"`
  43. }