Skip to content

Commit 480be18

Browse files
renovate[bot]Sean-Der
authored andcommitted
Update module github.com/pion/ice/v3 to v3.0.7
Generated by renovateBot
1 parent a97c420 commit 480be18

File tree

5 files changed

+58
-12
lines changed

5 files changed

+58
-12
lines changed

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.19
55
require (
66
github.com/pion/datachannel v1.5.6
77
github.com/pion/dtls/v2 v2.2.10
8-
github.com/pion/ice/v3 v3.0.6
8+
github.com/pion/ice/v3 v3.0.7
99
github.com/pion/interceptor v0.1.29
1010
github.com/pion/logging v0.2.2
1111
github.com/pion/randutil v0.1.0
@@ -18,7 +18,7 @@ require (
1818
github.com/pion/transport/v3 v3.0.2
1919
github.com/sclevine/agouti v3.0.0+incompatible
2020
github.com/stretchr/testify v1.9.0
21-
golang.org/x/net v0.22.0
21+
golang.org/x/net v0.24.0
2222
)
2323

2424
require (
@@ -28,9 +28,9 @@ require (
2828
github.com/onsi/gomega v1.17.0 // indirect
2929
github.com/pion/mdns/v2 v2.0.7 // indirect
3030
github.com/pion/transport/v2 v2.2.4 // indirect
31-
github.com/pion/turn/v3 v3.0.2 // indirect
31+
github.com/pion/turn/v3 v3.0.3 // indirect
3232
github.com/pmezard/go-difflib v1.0.0 // indirect
33-
golang.org/x/crypto v0.21.0 // indirect
34-
golang.org/x/sys v0.18.0 // indirect
33+
golang.org/x/crypto v0.22.0 // indirect
34+
golang.org/x/sys v0.19.0 // indirect
3535
gopkg.in/yaml.v3 v3.0.1 // indirect
3636
)

go.sum

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ github.com/pion/datachannel v1.5.6/go.mod h1:1eKT6Q85pRnr2mHiWHxJwO50SfZRtWHTsNI
4343
github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s=
4444
github.com/pion/dtls/v2 v2.2.10 h1:u2Axk+FyIR1VFTPurktB+1zoEPGIW3bmyj3LEFrXjAA=
4545
github.com/pion/dtls/v2 v2.2.10/go.mod h1:d9SYc9fch0CqK90mRk1dC7AkzzpwJj6u2GU3u+9pqFE=
46-
github.com/pion/ice/v3 v3.0.6 h1:UC5vZCMhmve7yv+Y6E5eTnRTl+t9LLtmeBYQ9038Zm8=
47-
github.com/pion/ice/v3 v3.0.6/go.mod h1:4eMTUKQEjC1fGQGB6qUzy2ux9Pc1v9EsO3hNaii+kXI=
46+
github.com/pion/ice/v3 v3.0.7 h1:dfMViRKblENqzorR2cQiiRKWqQfqKZ9+nT/sREX3ra8=
47+
github.com/pion/ice/v3 v3.0.7/go.mod h1:pBRcCoJRC0vwvFsemfRIqRLYukV4bPboGb0B4b8AhrQ=
4848
github.com/pion/interceptor v0.1.29 h1:39fsnlP1U8gw2JzOFWdfCU82vHvhW9o0rZnZF56wF+M=
4949
github.com/pion/interceptor v0.1.29/go.mod h1:ri+LGNjRUc5xUNtDEPzfdkmSqISixVTBF/z/Zms/6T4=
5050
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
@@ -74,8 +74,8 @@ github.com/pion/transport/v2 v2.2.4/go.mod h1:q2U/tf9FEfnSBGSW6w5Qp5PFWRLRj3NjLh
7474
github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0=
7575
github.com/pion/transport/v3 v3.0.2 h1:r+40RJR25S9w3jbA6/5uEPTzcdn7ncyU44RWCbHkLg4=
7676
github.com/pion/transport/v3 v3.0.2/go.mod h1:nIToODoOlb5If2jF9y2Igfx3PFYWfuXi37m0IlWa/D0=
77-
github.com/pion/turn/v3 v3.0.2 h1:iBonAIIKRwkVUJBFiFd/kSjytP7FlX0HwCyBDJPRDdU=
78-
github.com/pion/turn/v3 v3.0.2/go.mod h1:vw0Dz420q7VYAF3J4wJKzReLHIo2LGp4ev8nXQexYsc=
77+
github.com/pion/turn/v3 v3.0.3 h1:1e3GVk8gHZLPBA5LqadWYV60lmaKUaHCkm9DX9CkGcE=
78+
github.com/pion/turn/v3 v3.0.3/go.mod h1:vw0Dz420q7VYAF3J4wJKzReLHIo2LGp4ev8nXQexYsc=
7979
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
8080
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
8181
github.com/sclevine/agouti v3.0.0+incompatible h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4=
@@ -101,8 +101,9 @@ golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE
101101
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
102102
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
103103
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
104-
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
105104
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
105+
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
106+
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
106107
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
107108
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
108109
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
@@ -120,8 +121,9 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
120121
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
121122
golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
122123
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
123-
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
124124
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
125+
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
126+
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
125127
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
126128
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
127129
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -147,8 +149,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
147149
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
148150
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
149151
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
150-
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
151152
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
153+
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
154+
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
152155
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
153156
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
154157
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=

icegatherer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func (g *ICEGatherer) createAgent() error {
124124
ProxyDialer: g.api.settingEngine.iceProxyDialer,
125125
DisableActiveTCP: g.api.settingEngine.iceDisableActiveTCP,
126126
MaxBindingRequests: g.api.settingEngine.iceMaxBindingRequests,
127+
BindingRequestHandler: g.api.settingEngine.iceBindingRequestHandler,
127128
}
128129

129130
requestedNetworkTypes := g.api.settingEngine.candidates.ICENetworkTypes

settingengine.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
dtlsElliptic "github.com/pion/dtls/v2/pkg/crypto/elliptic"
1818
"github.com/pion/ice/v3"
1919
"github.com/pion/logging"
20+
"github.com/pion/stun/v2"
2021
"github.com/pion/transport/v3"
2122
"github.com/pion/transport/v3/packetio"
2223
"golang.org/x/net/proxy"
@@ -91,6 +92,7 @@ type SettingEngine struct {
9192
iceUDPMux ice.UDPMux
9293
iceProxyDialer proxy.Dialer
9394
iceDisableActiveTCP bool
95+
iceBindingRequestHandler func(m *stun.Message, local, remote ice.Candidate, pair *ice.CandidatePair) bool
9496
disableMediaEngineCopy bool
9597
srtpProtectionProfiles []dtls.SRTPProtectionProfile
9698
receiveMTU uint
@@ -458,3 +460,12 @@ func (e *SettingEngine) SetDTLSCustomerCipherSuites(customCipherSuites func() []
458460
func (e *SettingEngine) SetSCTPRTOMax(rtoMax time.Duration) {
459461
e.sctp.rtoMax = rtoMax
460462
}
463+
464+
// SetICEBindingRequestHandler sets a callback that is fired on a STUN BindingRequest
465+
// This allows users to do things like
466+
// - Log incoming Binding Requests for debugging
467+
// - Implement draft-thatcher-ice-renomination
468+
// - Implement custom CandidatePair switching logic
469+
func (e *SettingEngine) SetICEBindingRequestHandler(bindingRequestHandler func(m *stun.Message, local, remote ice.Candidate, pair *ice.CandidatePair) bool) {
470+
e.iceBindingRequestHandler = bindingRequestHandler
471+
}

settingengine_test.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"time"
1414

1515
"github.com/pion/dtls/v2/pkg/crypto/elliptic"
16+
"github.com/pion/ice/v3"
17+
"github.com/pion/stun/v2"
1618
"github.com/pion/transport/v3/test"
1719
"github.com/stretchr/testify/assert"
1820
)
@@ -278,3 +280,32 @@ func TestSetSCTPRTOMax(t *testing.T) {
278280
s.SetSCTPRTOMax(expSize)
279281
assert.Equal(t, expSize, s.sctp.rtoMax)
280282
}
283+
284+
func TestSetICEBindingRequestHandler(t *testing.T) {
285+
seenICEControlled, seenICEControlledCancel := context.WithCancel(context.Background())
286+
seenICEControlling, seenICEControllingCancel := context.WithCancel(context.Background())
287+
288+
s := SettingEngine{}
289+
s.SetICEBindingRequestHandler(func(m *stun.Message, _, _ ice.Candidate, _ *ice.CandidatePair) bool {
290+
for _, a := range m.Attributes {
291+
switch a.Type {
292+
case stun.AttrICEControlled:
293+
seenICEControlledCancel()
294+
case stun.AttrICEControlling:
295+
seenICEControllingCancel()
296+
default:
297+
}
298+
}
299+
300+
return false
301+
})
302+
303+
pcOffer, pcAnswer, err := NewAPI(WithSettingEngine(s)).newPair(Configuration{})
304+
assert.NoError(t, err)
305+
306+
assert.NoError(t, signalPair(pcOffer, pcAnswer))
307+
308+
<-seenICEControlled.Done()
309+
<-seenICEControlling.Done()
310+
closePairNow(t, pcOffer, pcAnswer)
311+
}

0 commit comments

Comments
 (0)