Sign inSign up

dmitry0xff/iperf3-ws-relay

By dmitry0xff

•Updated 3 months ago

WebSocket-to-TCP relay with bundled iperf3, so a Samsung Tizen TV app can speed test itself

Image
0

984

dmitry0xff/iperf3-ws-relay repository overview

⁠iperf3 WebSocket→TCP relay

The server side of samsung-tv-iperf3⁠ — a network speed test for Samsung Smart TVs.

A Tizen TV app runs in a browser sandbox: it cannot execute a binary, so it cannot run iperf3 as a process, and it has no raw TCP sockets — only fetch, XHR and WebSocket. The TV therefore speaks the real iperf3 wire protocol in JavaScript, and this relay supplies the one capability the sandbox withholds: each WebSocket is paired 1:1 with a TCP connection to an iperf3 server, bytes passed through untouched. iperf3's own model — first connection is the control channel, later ones bearing the same cookie are data streams — survives intact.

The image bundles its own iperf3 -s, so there is nothing else to install and no clash with an iperf3 you may already run on :5201.

⁠Usage

docker run -d --name iperf3-ws-relay --restart unless-stopped \
  -p 5202:5202 -p 15201:5201 \
  dmitry0xff/iperf3-ws-relay:latest

Then build and sideload the TV app with that host's address — see the repository README⁠.

linux/amd64 and linux/arm64 are both published, so x86 servers and ARM NAS/Pi hosts pull the right image automatically.

⁠Ports

PortPurpose
5202WebSocket relay — what the TV connects to
5201the bundled iperf3; map it high (e.g. 15201:5201) to calibrate with a native iperf3 -c

⁠Environment

VariableDefaultPurpose
RELAY_PORT5202WebSocket listen port
IPERF_HOST127.0.0.1iperf3 to relay to. Set this to an external server and the container skips starting its own
IPERF_PORT5201iperf3 port
IDLE_TIMEOUT_MS300000drops genuinely silent sockets. Must exceed the longest test duration — the control connection is idle for the whole test body

⁠Notes

  • WebSocket compression is disabled and must stay that way: the iperf3 payload is highly compressible, so permessage-deflate would both inflate the reported throughput and cap the real throughput on CPU.
  • Run the relay next to the iperf3 server, so the only measured hop is the TV's own link.
  • Docker Compose file, TV app, and the protocol notes are all in the GitHub repository⁠. MIT licensed.

Tag summary

Content type

Image

Digest

sha256:80031c8a3…

Size

46.4 MB

Last updated

3 months ago

docker pull dmitry0xff/iperf3-ws-relay