configuration.go 2.5 KB

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