github.com/pion/webrtc/v4@v4.0.1/configuration.go (about)

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