rtspsrc: Add support to ignore x-server HEADER reply
authorPer Förlin <perfn@axis.com>
Tue, 1 Jun 2021 13:33:01 +0000 (15:33 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 17 Aug 2021 10:15:27 +0000 (10:15 +0000)
commit9a216d0ffa34d371b1b6e6e48631a4ebd0d7bdc0
treed09a7ea708a853d6baaeb22897173972ef0c5aad
parenta92c855dd520b0eff2da6b770ac62c3990306ea2
rtspsrc: Add support to ignore x-server HEADER reply

When connecting to an RTSP server in tunnled mode (HTTP) the server
usually replies with a x-server header. This contains the address
of the intended streaming server. However some servers return an
"invalid" address. Here follows two examples when it might happen.

1. A server use Apache combined with a separate RTSP process to handle
   Https request on port 443. In this case Apache handle TLS and
   connects to the local RTSP server, which results in a local
   address 127.0.0.1 or ::1 in the x-server reply. This address is
   returned to the actual RTSP client in the x-server header.
   The client will receive this address and try to  connect to it
   and fail.

2. The client use a ipv6 link local address with a specified scope id
   fe80::aaaa:bbbb:cccc:dddd%eth0 and connects via Http on port 80.
   The RTSP server receives the connection and returns the address
   in the x-server header. The client will receive this address and
   try to connect to it "as is" without the scope id and fail.

In the case of streaming data from RTSP servers like 1. and 2. it's
useful to have the option to simply ignore the x-server header reply
and continue using the original address.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1007>
docs/gst_plugins_cache.json
gst/rtsp/gstrtspsrc.c
gst/rtsp/gstrtspsrc.h