mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 15:35:41 +00:00
single port mode connectivity improvements, ICE v2.1.6
This commit is contained in:
@@ -36,6 +36,10 @@ locals {
|
||||
containerPort = var.turn_udp_port
|
||||
protocol = "udp"
|
||||
},
|
||||
{
|
||||
containerPort = var.rtc_udp_port
|
||||
protocol = "udp"
|
||||
},
|
||||
{
|
||||
containerPort = var.rtc_tcp_port
|
||||
protocol = "tcp"
|
||||
|
||||
6
go.mod
6
go.mod
@@ -15,7 +15,7 @@ require (
|
||||
github.com/magefile/mage v1.11.0
|
||||
github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0
|
||||
github.com/mitchellh/go-homedir v1.1.0
|
||||
github.com/pion/ice/v2 v2.1.4
|
||||
github.com/pion/ice/v2 v2.1.6
|
||||
github.com/pion/ion-sfu v1.9.7
|
||||
github.com/pion/logging v0.2.2
|
||||
github.com/pion/rtcp v1.2.6
|
||||
@@ -37,8 +37,8 @@ require (
|
||||
go.uber.org/zap v1.16.0
|
||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect
|
||||
golang.org/x/mod v0.4.2 // indirect
|
||||
golang.org/x/net v0.0.0-20210421230115-4e50805a0758 // indirect
|
||||
golang.org/x/sys v0.0.0-20210421221651-33663a62ff08 // indirect
|
||||
golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6 // indirect
|
||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7 // indirect
|
||||
golang.org/x/tools v0.1.0 // indirect
|
||||
google.golang.org/protobuf v1.25.0
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||
|
||||
10
go.sum
10
go.sum
@@ -70,6 +70,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davidzhao/ice/v2 v2.0.17-0.20210425192821-8eeae55b4708 h1:wuF8jQJrUhwb9tT+IftzQ3VYve9WKifWhocYmMY+1go=
|
||||
github.com/davidzhao/ice/v2 v2.0.17-0.20210425192821-8eeae55b4708/go.mod h1:kV4EODVD5ux2z8XncbLHIOtcXKtYXVgLVCeVqnpoeP0=
|
||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE=
|
||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
@@ -317,8 +319,9 @@ github.com/pion/dtls/v2 v2.0.8/go.mod h1:QuDII+8FVvk9Dp5t5vYIMTo7hh7uBkra+8QIm7Q
|
||||
github.com/pion/dtls/v2 v2.0.9 h1:7Ow+V++YSZQMYzggI0P9vLJz/hUFcffsfGMfT/Qy+u8=
|
||||
github.com/pion/dtls/v2 v2.0.9/go.mod h1:O0Wr7si/Zj5/EBFlDzDd6UtVxx25CE1r7XM7BQKYQho=
|
||||
github.com/pion/ice/v2 v2.0.15/go.mod h1:ZIiVGevpgAxF/cXiIVmuIUtCb3Xs4gCzCbXB6+nFkSI=
|
||||
github.com/pion/ice/v2 v2.1.4 h1:ABtU8cncApRGERYiTdtagTzVs5oRqL9gUF8sJeXI8EA=
|
||||
github.com/pion/ice/v2 v2.1.4/go.mod h1:kV4EODVD5ux2z8XncbLHIOtcXKtYXVgLVCeVqnpoeP0=
|
||||
github.com/pion/ice/v2 v2.1.6 h1:PyqyUY9dTAjTrUmCq9qY6Yy3FagZlh5HQIVr27cwF6g=
|
||||
github.com/pion/ice/v2 v2.1.6/go.mod h1:kV4EODVD5ux2z8XncbLHIOtcXKtYXVgLVCeVqnpoeP0=
|
||||
github.com/pion/interceptor v0.0.9/go.mod h1:dHgEP5dtxOTf21MObuBAjJeAayPxLUAZjerGH8Xr07c=
|
||||
github.com/pion/interceptor v0.0.12 h1:eC1iVneBIAQJEfaNAfDqAncJWhMDAnaXPRCJsltdokE=
|
||||
github.com/pion/interceptor v0.0.12/go.mod h1:qzeuWuD/ZXvPqOnxNcnhWfkCZ2e1kwwslicyyPnhoK4=
|
||||
@@ -569,6 +572,8 @@ golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96b
|
||||
golang.org/x/net v0.0.0-20210420210106-798c2154c571/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
|
||||
golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY=
|
||||
golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
|
||||
golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6 h1:0PC75Fz/kyMGhL0e1QnypqK2kQMqKt9csD1GnMJR+Zk=
|
||||
golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -620,6 +625,9 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210421221651-33663a62ff08 h1:qyN5bV+96OX8pL78eXDuz6YlDPzCYgdW74H5yE9BoSU=
|
||||
golang.org/x/sys v0.0.0-20210421221651-33663a62ff08/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7 h1:iGu644GcxtEcrInvDsQRCwJjtCIOlT2V7IRt6ah2Whw=
|
||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
|
||||
@@ -67,8 +67,7 @@ func NewConfig(confString string) (*Config, error) {
|
||||
conf := &Config{
|
||||
Port: 7880,
|
||||
RTC: RTCConfig{
|
||||
UseExternalIP: true,
|
||||
|
||||
UseExternalIP: true,
|
||||
ICEPortRangeStart: 9000,
|
||||
ICEPortRangeEnd: 11000,
|
||||
StunServers: []string{
|
||||
|
||||
@@ -61,12 +61,13 @@ func NewWebRTCConfig(conf *config.RTCConfig, externalIP string) (*WebRTCConfig,
|
||||
networkTypes := make([]webrtc.NetworkType, 0, 4)
|
||||
if !conf.ForceTCP {
|
||||
networkTypes = append(networkTypes,
|
||||
webrtc.NetworkTypeUDP4)
|
||||
webrtc.NetworkTypeUDP4,
|
||||
)
|
||||
}
|
||||
|
||||
var udpMux *ice.UDPMuxDefault
|
||||
if conf.UDPPort != 0 {
|
||||
conn, err := net.ListenUDP("udp", &net.UDPAddr{
|
||||
conn, err := net.ListenUDP("udp4", &net.UDPAddr{
|
||||
Port: int(conf.UDPPort),
|
||||
})
|
||||
if err != nil {
|
||||
@@ -88,7 +89,7 @@ func NewWebRTCConfig(conf *config.RTCConfig, externalIP string) (*WebRTCConfig,
|
||||
networkTypes = append(networkTypes,
|
||||
webrtc.NetworkTypeTCP4,
|
||||
)
|
||||
tcpListener, err := net.ListenTCP("tcp", &net.TCPAddr{
|
||||
tcpListener, err := net.ListenTCP("tcp4", &net.TCPAddr{
|
||||
Port: int(conf.TCPPort),
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -547,10 +547,12 @@ func (p *ParticipantImpl) sendIceCandidate(c *webrtc.ICECandidate, target liveki
|
||||
ci := c.ToJSON()
|
||||
|
||||
// write candidate
|
||||
//logger.Debugw("sending ice candidates")
|
||||
logger.Debugw("sending ice candidates",
|
||||
"participant", p.Identity(),
|
||||
"candidate", c.String())
|
||||
trickle := ToProtoTrickle(ci)
|
||||
trickle.Target = target
|
||||
p.writeMessage(&livekit.SignalResponse{
|
||||
_ = p.writeMessage(&livekit.SignalResponse{
|
||||
Message: &livekit.SignalResponse_Trickle{
|
||||
Trickle: trickle,
|
||||
},
|
||||
|
||||
@@ -125,7 +125,7 @@ func (s *LivekitServer) Start() error {
|
||||
if s.config.RTC.TCPPort != 0 {
|
||||
values = append(values, "rtc.tcp_port", s.config.RTC.TCPPort)
|
||||
}
|
||||
if s.config.RTC.UDPPort != 0 {
|
||||
if !s.config.RTC.ForceTCP && s.config.RTC.UDPPort != 0 {
|
||||
values = append(values, "rtc.udp_port", s.config.RTC.UDPPort)
|
||||
} else {
|
||||
values = append(values,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package version
|
||||
|
||||
const Version = "0.8.4"
|
||||
const Version = "0.8.5"
|
||||
|
||||
Reference in New Issue
Block a user