Populate network field when set by clients (#919)

This commit is contained in:
David Zhao
2022-08-15 23:28:15 -07:00
committed by GitHub
parent 6b48fbc577
commit 1d199d1efa
5 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ require (
github.com/gorilla/websocket v1.5.0
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/golang-lru v0.5.4
github.com/livekit/protocol v1.0.1-0.20220814074051-ac91aad4ad8c
github.com/livekit/protocol v1.0.1
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995
github.com/mackerelio/go-osstat v0.2.2
github.com/magefile/mage v1.13.0
+2 -2
View File
@@ -240,8 +240,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lithammer/shortuuid/v3 v3.0.7 h1:trX0KTHy4Pbwo/6ia8fscyHoGA+mf1jWbPJVuvyJQQ8=
github.com/lithammer/shortuuid/v3 v3.0.7/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts=
github.com/livekit/protocol v1.0.1-0.20220814074051-ac91aad4ad8c h1:SX39A/GXStqvlDSAKIp8cxVkhdOEMAV+ufZrNpo2cPs=
github.com/livekit/protocol v1.0.1-0.20220814074051-ac91aad4ad8c/go.mod h1:hN0rI0/QsnGXp3oYnFktdquU3FPetAl8/naweFo6oPs=
github.com/livekit/protocol v1.0.1 h1:WgJyGPijoBeZInVhPWQfPYEIjRKkDKMaOQU1IX1co08=
github.com/livekit/protocol v1.0.1/go.mod h1:hN0rI0/QsnGXp3oYnFktdquU3FPetAl8/naweFo6oPs=
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995 h1:vOaY2qvfLihDyeZtnGGN1Law9wRrw8BMGCr1TygTvMw=
github.com/livekit/rtcscore-go v0.0.0-20220815072451-20ee10ae1995/go.mod h1:116ych8UaEs9vfIE8n6iZCZ30iagUFTls0vRmC+Ix5U=
github.com/mackerelio/go-osstat v0.2.2 h1:7jVyXGXTkQL3+6lDVUDBY+Fpo8VQPfyOkZeXxxsXX4c=
+1 -1
View File
@@ -815,7 +815,7 @@ func (t *PCTransport) OnAnswer(f func(sd webrtc.SessionDescription)) {
t.onAnswer = f
}
func (t *PCTransport) OnRemoteDescripitonSettled(f func() error) {
func (t *PCTransport) OnRemoteDescriptionSettled(f func() error) {
t.lock.Lock()
t.onRemoteDescriptionSettled = f
t.lock.Unlock()
+1 -1
View File
@@ -92,7 +92,7 @@ func NewTransportManager(params TransportManagerParams) (*TransportManager, erro
return nil, err
}
t.publisher = publisher
t.publisher.OnRemoteDescripitonSettled(t.createPublisherAnswerAndSend)
t.publisher.OnRemoteDescriptionSettled(t.createPublisherAnswerAndSend)
t.publisher.OnInitialConnected(func() {
if !t.params.SubscriberAsPrimary && t.onPrimaryTransportInitialConnected != nil {
t.onPrimaryTransportInitialConnected()
+1
View File
@@ -299,6 +299,7 @@ func (s *RTCService) ParseClientInfo(r *http.Request) *livekit.ClientInfo {
ci.Browser = values.Get("browser")
ci.BrowserVersion = values.Get("browser_version")
ci.DeviceModel = values.Get("device_model")
ci.Network = values.Get("network")
// get real address (forwarded http header) - check Cloudflare headers first, fall back to X-Forwarded-For
ci.Address = r.Header.Get("CF-Connecting-IP")
if len(ci.Address) == 0 {