gstrtspconnection: Add support to ignore x-server header reply
authorPer Förlin <perfn@axis.com>
Tue, 1 Jun 2021 13:27:31 +0000 (15:27 +0200)
committerNirbheek Chauhan <nirbheek@centricular.com>
Mon, 16 Aug 2021 09:06:37 +0000 (09:06 +0000)
commit535c02c73b62eb1d9d72e77be873e11e6c94051e
tree41009f5ec45182dcf7896c0c6df123e13a7ce06f
parent3ced923da5baf8b7f64dc3b126195aae9b835099
gstrtspconnection: 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-base/-/merge_requests/1192>
gst-libs/gst/rtsp/gstrtspconnection.c
gst-libs/gst/rtsp/gstrtspconnection.h