mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-09-29 13:42:11 +08:00
13 lines
205 B
Go
13 lines
205 B
Go
package tcp
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func RemoteAddr(r *http.Request) string {
|
|
if remote := r.Header.Get("X-Forwarded-For"); remote != "" {
|
|
return remote + ", " + r.RemoteAddr
|
|
}
|
|
return r.RemoteAddr
|
|
}
|