Files
rtsp-simple-server/internal/core/http_set_trusted_proxies.go
2023-05-16 16:14:20 +02:00

16 lines
330 B
Go

package core
import (
"github.com/gin-gonic/gin"
"github.com/bluenviron/mediamtx/internal/conf"
)
func httpSetTrustedProxies(router *gin.Engine, trustedProxies conf.IPsOrCIDRs) {
tmp := make([]string, len(trustedProxies))
for i, entry := range trustedProxies {
tmp[i] = entry.String()
}
router.SetTrustedProxies(tmp)
}