A lightweight test server for verifying L4 proxy route configurations. Works with any proxy that supports L4 TCP/UDP routing (e.g. Caddy L4, HAProxy, Envoy). Serves a styled HTML page with connection details (Proxy Protocol v1/v2 or none) and streams Big Buck Bunny as a live video via UDP -> HTTP chunked stream -> browser -- all in a single Python script with no pip dependencies.
- TCP server (port
11111) -- Accepts plain HTTP or Proxy Protocol v1/v2 prefixed connections. Returns an HTML page with connection details and a live video player. - UDP video receiver (port
22222) -- Receives MPEG-TS packets and broadcasts them to all connected HTTP stream clients. - Built-in video source -- FFmpeg (bundled in Docker/exe) streams
bigbuckbunny.tsin a loop on startup. - Proxy Protocol detection -- Automatically distinguishes between no proxy, v1 (text), and v2 (binary) headers.
- Interactive UDP target -- The page lets you redirect FFmpeg UDP stream to any IP:port to verify L4 routing end-to-end.
- MPEG-TS diagnostics -- Real-time packet rate sparkline, CC error tracking, and datagram size/alignment monitoring.
docker pull ghcr.io/zsdonny/l4-proxy-test-server:latest
docker run -d --name test-stream -p 11111:11111/tcp -p 22222:22222/udp ghcr.io/zsdonny/l4-proxy-test-server:latestPre-built binaries with FFmpeg, bigbuckbunny.ts, and JSMpeg bundled are on the GitHub Releases page.
Windows: Download L4-Proxy-Test-Server.exe and run it (or double-click). Accept the SmartScreen prompt if it appears.
macOS: Download and unzip L4-Proxy-Test-Server-macos.zip. Right-click > Open to bypass Gatekeeper, or run:
xattr -d com.apple.quarantine "L4 Proxy Test Server.app"Open a browser at http://localhost:11111 (or the proxied URL). The page shows whether the connection arrived with no proxy protocol, Proxy Protocol v1, or v2.
# Plain HTTP
curl http://localhost:11111
# Proxy Protocol v1
echo -e "PROXY TCP4 192.168.1.100 10.0.0.1 12345 80\r\nGET / HTTP/1.1\r\n\r\n" | nc localhost 11111The page includes a built-in JSMpeg player. Video streams automatically when the container/exe runs.
To test L4 UDP routing:
- Configure your proxy to forward a UDP port (e.g.
44444) to the server UDP port (22222). - On the page, set the IP and Port fields to the proxy address/port and click Send.
- FFmpeg restarts targeting the proxy. If routing works, video continues and the flow diagram updates:
Direct: FFmpeg -> UDP :22222 (direct) -> server -> HTTP stream -> Browser
Proxied: FFmpeg -> UDP 127.0.0.1:44444 -> L4 proxy -> UDP :22222 -> server -> HTTP stream -> Browser
Diagnostics below the player show packet rate, CC errors (should be 0), and datagram alignment -- useful for spotting proxy-induced packet corruption.
ffmpeg -re -stream_loop -1 \
-i https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4 \
-f mpegts -codec:v mpeg1video -b:v 800k -bf 0 udp://localhost:22222| Variable | Default | Description |
|---|---|---|
TCP_PORT |
11111 |
TCP listen port |
UDP_PORT |
22222 |
UDP listen port |
DOCKER_HOST_ADDR |
host.docker.internal |
Host address for proxied UDP targets |
- Source code: MIT License
bigbuckbunny.ts: © Blender Foundation, CC-BY-3.0jsmpeg.min.js: © 2017 Dominic Szablewski, MIT License