Testing RTSP over HTTP: A Step-by-Step Guide

Learn how to configure and test RTSP over HTTP functionality to bypass firewall restrictions and ensure reliable streaming in restrictive networks.

📌 Important clarification: RTSP over HTTP does not mean you can play RTSP streams directly in a web browser. It is a tunneling technique that encapsulates RTSP and RTP within HTTP/HTTPS requests to traverse firewalls. The stream still requires a client that supports RTSP over HTTP (like VLC or Happytime RTSP Client) to decode and play the media.

What is RTSP over HTTP?

RTSP (Real Time Streaming Protocol) typically uses ports like 554, which may be blocked by corporate or public firewalls. RTSP over HTTP wraps the RTSP control messages and data inside standard HTTP (port 80) or HTTPS (port 443) requests, allowing the stream to pass through almost any firewall that allows web traffic. It is especially useful for video surveillance, remote access, or any scenario where network policies restrict non-standard ports.


Configuration Modifications

To enable RTSP over HTTP on the server side, you need to modify the RTSP server configuration file (rtspserver.cfg). Below are the essential settings:

Step 1: Enable HTTP Tunnel

<rtsp_over_http>1</rtsp_over_http>
<http_port>8080</http_port>   <!-- Choose any available port -->

Step 2: (Optional) Enable HTTPS Tunnel

<rtsp_over_https>1</rtsp_over_https>
<https_port>8443</https_port>
<https_cert>/path/to/certificate.pem</https_cert>
<https_key>/path/to/private-key.pem</https_key>

After saving the changes, restart the RTSP server. The server will now listen for tunneled RTSP requests on the specified HTTP/HTTPS ports.


Testing with VLC Media Player

VLC has built-in support for RTSP over HTTP tunneling. Follow these steps to verify the configuration:

Step 1: Open VLC Advanced Preferences

Go to Tools → Preferences (or press Ctrl+P). In the bottom-left corner, under Show settings, choose All to access advanced options.

Step 2: Configure HTTP Tunnel

Navigate to Input / Codecs → Access modules → RTP/RTSP. On the right panel, check the box "Use RTP over RTSP (HTTP tunnel)". Then set the HTTP tunnel port to the same value you configured in rtspserver.cfg (e.g., 8080).

Step 3: Play the Stream

Close the preferences. Click Media → Open Network Stream. Enter the standard RTSP URL, for example:

rtsp://192.168.1.100:554/test.mp4

VLC will automatically tunnel the RTSP traffic through the configured HTTP port. If the video plays, RTSP over HTTP is working correctly.


Testing with Happytime RTSP Client

The dedicated Happytime RTSP Client provides a simpler way to test, allowing direct HTTP/HTTPS URLs.

Step 1: Launch the Client

Open Happytime RTSP Client application.

Step 2: Input the Tunneled URL

Click the play button in the video window. Enter the stream address using the following format:

The client automatically encapsulates the request as RTSP over HTTP.

Step 3: Verify Playback

Press OK. If the video renders, the tunnel is operational.


Common Issues & Tips


Configuration Summary

Key sections to verify in rtspserver.cfg:

<rtsp_over_http>1</rtsp_over_http>
<http_port>8080</http_port>

<rtsp_over_https>0</rtsp_over_https>   <!-- Set to 1 if HTTPS needed -->
<https_port>8443</https_port>
<https_cert>./cert.pem</https_cert>
<https_key>./key.pem</https_key>

Conclusion

RTSP over HTTP is a valuable technique to ensure streaming continuity in firewalled environments. By correctly configuring the RTSP server and using compatible clients like VLC or Happytime RTSP Client, you can easily verify the tunnel and deploy robust streaming solutions. Remember that it is a transport tunnel, not a web playback solution.

RTSP over HTTP HTTP Tunnel Firewall Bypass