If you're looking for a simple way to securely access your RTSP camera feed over the internet using VLC, without relying on cloud services or complex tools, this post is for you.
In this guide, we’ll use socat to create a TCP proxy for your camera feed and expose it via NetBird—a secure WireGuard-based overlay network. Ideal for remote monitoring scenarios like IP CCTV streaming from a Raspberry Pi or mini PC.
Prerequisites
- A Linux mini PC (e.g., Raspberry Pi, Intel NUC)
- RTSP-capable IP camera (e.g., rtsp://192.168.29.2:554/live/ch00_0)
- NetBird installed and running on both mini PC and remote device
- VLC media player installed on the remote device
Step 1: Install socat on Your Mini PC/Home Server/Raspberry Pi
Update and install socat:
sudo apt update && sudo apt install socat
Step 2: Start the Proxy
Use socat to forward traffic from a local port (8554) to your camera’s RTSP port (554):
socat TCP-LISTEN:8554,fork TCP:192.168.29.2:554
Now, your mini PC listens on port 8554 and pipes all incoming connections to the camera at 192.168.29.2:554.
NB: 192.168.29.2 is the IP assigned to my Camera
Step 3: Create a systemd Service (Optional but Recommended)
To make sure the proxy runs automatically after every reboot:
sudo nano /etc/systemd/system/camera-proxy.service
Paste the following:
[Unit]
Description=RTSP Camera Proxy via socat
After=network.target
[Service]
ExecStart=/usr/bin/socat TCP-LISTEN:8554,fork TCP:192.168.29.2:554
Restart=always
User=mahesh
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
Save and exit.
Step 4: Enable and Start the Service
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable camera-proxy.service
sudo systemctl start camera-proxy.service
Step 5: Check if the Proxy is Running
sudo systemctl status camera-proxy.service
Look for Active: active (running).
Step 6: Stream via VLC From Anywhere
On your remote device connected via NetBird, open VLC and go to:
Replace <NetBird-IP-of-mini-pc> with the actual IP assigned to your mini-PC by NetBird.
Why This Works Well
- NetBird ensures secure and encrypted access without port-forwarding or public exposure.
- socat provides a lightweight and fast proxy solution.
- VLC handles RTSP streams with ease.