Add support X-Forwarded-For

This commit is contained in:
Alexey Khit
2023-03-25 11:59:55 +03:00
parent a42c3e21c9
commit 8bf5c85b79
5 changed files with 24 additions and 8 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"github.com/AlexxIT/go2rtc/cmd/streams"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/mp4"
"github.com/AlexxIT/go2rtc/pkg/tcp"
"github.com/rs/zerolog"
"net/http"
"strconv"
@@ -103,7 +104,7 @@ func handlerMP4(w http.ResponseWriter, r *http.Request) {
exit := make(chan error)
cons := &mp4.Consumer{
RemoteAddr: r.RemoteAddr,
RemoteAddr: tcp.RemoteAddr(r),
UserAgent: r.UserAgent(),
Medias: core.ParseQuery(r.URL.Query()),
}