Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ func (e *RTCEngine) createPublisherPCLocked(configuration webrtc.Configuration)
OnRTTUpdate: e.setRTT,
IsSender: true,
DTLSEllipticCurves: e.connParams.DTLSEllipticCurves,
NetworkTypes: e.connParams.NetworkTypes,
}); err != nil {
return err
}
Expand Down Expand Up @@ -508,6 +509,7 @@ func (e *RTCEngine) createSubscriberPCLocked(configuration webrtc.Configuration)
Interceptors: e.connParams.Interceptors,
IncludeDefaultInterceptors: e.connParams.IncludeDefaultInterceptors,
DTLSEllipticCurves: e.connParams.DTLSEllipticCurves,
NetworkTypes: e.connParams.NetworkTypes,
}); err != nil {
return err
}
Expand Down
10 changes: 10 additions & 0 deletions room.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,16 @@ func WithDTLSEllipticCurves(curves ...dtlsElliptic.Curve) ConnectOption {
}
}

// WithNetworkTypes restricts ICE candidate gathering to the specified network types.
// For example, to force IPv6-only ICE candidates:
//
// lksdk.WithNetworkTypes([]webrtc.NetworkType{webrtc.NetworkTypeUDP6, webrtc.NetworkTypeTCP6})
func WithNetworkTypes(types []webrtc.NetworkType) ConnectOption {
return func(p *connParams) {
p.NetworkTypes = types
}
}

func WithLogger(l protoLogger.Logger) ConnectOption {
return func(p *connParams) {
p.Logger = l
Expand Down
2 changes: 2 additions & 0 deletions signalling/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ type ConnectParams struct {

DTLSEllipticCurves []dtlsElliptic.Curve // FIPS 140: override default DTLS curves

NetworkTypes []webrtc.NetworkType

// DataEncryptionKeyProvider enables data channel E2EE when set.
DataEncryptionKeyProvider e2eetypes.KeyProvider

Expand Down
4 changes: 4 additions & 0 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ type PCTransportParams struct {
OnRTTUpdate func(rtt uint32)
IsSender bool
DTLSEllipticCurves []dtlsElliptic.Curve
NetworkTypes []webrtc.NetworkType
}

func (t *PCTransport) registerDefaultInterceptors(params PCTransportParams, i *interceptor.Registry) error {
Expand Down Expand Up @@ -214,6 +215,9 @@ func NewPCTransport(params PCTransportParams) (*PCTransport, error) {
se.SetDTLSEllipticCurves(params.DTLSEllipticCurves...)
}
se.SetDTLSRetransmissionInterval(dtlsRetransmissionInterval)
if len(params.NetworkTypes) > 0 {
se.SetNetworkTypes(params.NetworkTypes)
}
se.SetICETimeouts(iceDisconnectedTimeout, iceFailedTimeout, iceKeepaliveInterval)
lf := pionlogger.NewLoggerFactory(logger)
if lf != nil {
Expand Down
Loading