mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 04:22:00 -08:00
webrtc: show both IP and port during session creation and in API (#2096)
This commit is contained in:
parent
2e476cf4e0
commit
3bb12e2a0a
1 changed files with 5 additions and 2 deletions
|
|
@ -291,6 +291,9 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
ip := ctx.ClientIP()
|
||||
_, port, _ := net.SplitHostPort(ctx.Request.RemoteAddr)
|
||||
|
||||
user, pass, hasCredentials := ctx.Request.BasicAuth()
|
||||
|
||||
res := s.pathManager.getConfForPath(pathGetConfForPathReq{
|
||||
|
|
@ -298,7 +301,7 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) {
|
|||
publish: publish,
|
||||
credentials: authCredentials{
|
||||
query: ctx.Request.URL.RawQuery,
|
||||
ip: net.ParseIP(ctx.ClientIP()),
|
||||
ip: net.ParseIP(ip),
|
||||
user: user,
|
||||
pass: pass,
|
||||
proto: authProtocolWebRTC,
|
||||
|
|
@ -353,7 +356,7 @@ func (s *webRTCHTTPServer) onRequest(ctx *gin.Context) {
|
|||
|
||||
res := s.parent.sessionNew(webRTCSessionNewReq{
|
||||
pathName: dir,
|
||||
remoteAddr: ctx.ClientIP(),
|
||||
remoteAddr: net.JoinHostPort(ip, port),
|
||||
offer: offer,
|
||||
publish: (fname == "whip"),
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue