Get clients remote address from request (#385)

Signed-off-by: shishir gowda <shishir@livekit.io>
This commit is contained in:
shishirng
2022-01-29 10:51:21 -05:00
committed by GitHub
parent 3bfdb2523e
commit 7ac3631b6c
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ require (
github.com/google/wire v0.5.0
github.com/gorilla/websocket v1.4.2
github.com/hashicorp/golang-lru v0.5.4
github.com/livekit/protocol v0.11.12-0.20220127201730-77f0aed23c8a
github.com/livekit/protocol v0.11.12-0.20220129153628-d79c2afbfc88
github.com/magefile/mage v1.11.0
github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0
github.com/mitchellh/go-homedir v1.1.0
+4 -2
View File
@@ -132,8 +132,10 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lithammer/shortuuid/v3 v3.0.6 h1:pr15YQyvhiSX/qPxncFtqk+v4xLEpOZObbsY/mKrcvA=
github.com/lithammer/shortuuid/v3 v3.0.6/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts=
github.com/livekit/protocol v0.11.12-0.20220127201730-77f0aed23c8a h1:e16IjJzW23GUXypGbSxn6Esa3xWujJo1QyGsz/68f/M=
github.com/livekit/protocol v0.11.12-0.20220127201730-77f0aed23c8a/go.mod h1:YoHW9YbWbPnuVsgwBB4hAINKT+V68jmfh9zXBSSn6Wg=
github.com/livekit/protocol v0.11.12-0.20220128183138-c7382f7da42a h1:C5EmGcuCNhGUeE0eceUogn8HyftN3kSkWYrsdQxNogE=
github.com/livekit/protocol v0.11.12-0.20220128183138-c7382f7da42a/go.mod h1:YoHW9YbWbPnuVsgwBB4hAINKT+V68jmfh9zXBSSn6Wg=
github.com/livekit/protocol v0.11.12-0.20220129153628-d79c2afbfc88 h1:eWawullswNKmyhN5kIDp2Ba5iv2UDIluEQ5/OKilg08=
github.com/livekit/protocol v0.11.12-0.20220129153628-d79c2afbfc88/go.mod h1:YoHW9YbWbPnuVsgwBB4hAINKT+V68jmfh9zXBSSn6Wg=
github.com/magefile/mage v1.11.0 h1:C/55Ywp9BpgVVclD3lRnSYCwXTYxmSppIgLeDYlNuls=
github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
+1
View File
@@ -283,6 +283,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.Address = r.RemoteAddr
// attempt to parse types for SDKs that support browser as a platform
if ci.Sdk == livekit.ClientInfo_JS ||