@libp2p/webrtc 4.0.34-d1f1c2be7 → 4.1.0-0b55625d1

Sign up to get free protection for your applications and to get access to all the features.
@@ -52,6 +52,7 @@ export interface WebRTCMetrics {
52
52
  }
53
53
 
54
54
  export interface WebRTCTransportDirectInit {
55
+ rtcConfiguration?: RTCConfiguration | (() => RTCConfiguration | Promise<RTCConfiguration>)
55
56
  dataChannel?: DataChannelOptions
56
57
  }
57
58
 
@@ -137,7 +138,10 @@ export class WebRTCDirectTransport implements Transport {
137
138
  hash: sdp.toSupportedHashFunction(remoteCerthash.name)
138
139
  } as any)
139
140
 
140
- const peerConnection = new RTCPeerConnection({ certificates: [certificate] })
141
+ const peerConnection = new RTCPeerConnection({
142
+ ...(typeof this.init.rtcConfiguration === 'function' ? await this.init.rtcConfiguration() : this.init.rtcConfiguration ?? {}),
143
+ certificates: [certificate]
144
+ })
141
145
 
142
146
  try {
143
147
  // create data channel for running the noise handshake. Once the data channel is opened,