Project_Detail
All_Projects

rtl_relay

Self-hosted multi-user RTL-SDR relay over rtl_tcp

View on GitHub
README.md

rtl_relay

A self-hosted relay that lets multiple users listen to a single RTL-SDR simultaneously over the internet.

One SDR dongle, unlimited listeners. The first connected user controls tuning and gain; everyone else receives the same I/Q stream in parallel. All clients use the standard rtl_tcp protocol — SDR#, GQRX, and SDR++ work natively.

Architecture

[SDR App] ──rtl_tcp──► [Relay Server] ◄══WebSocket══► [Relay Client] ──USB──► [RTL-SDR]
  (SDR++)       TCP      (central broker)  (IQ + cmds)   (machine with HW)    (dongle)
  • Relay Server — Runs on a VPS or server with a public IP. Exposes TCP ports that mimic rtl_tcp for end users, and communicates with relay clients via WebSocket.
  • Relay Client — Runs on the machine with the SDR dongle plugged in. Connects to the relay server and streams raw I/Q samples.

Quick Start

Server (on your VPS)

./rtl_relay --server --ws-addr :8080 --ports 20000-21000 --hostname your-domain.com
Flag Default Description
--server required Enable server mode
--ws-addr :8080 WebSocket listen address for relay clients
--ports 20000-21000 TCP port range for SDR endpoints
--hostname (auto-detected) Public hostname shown to users as endpoint

Client (on the SDR machine)

./rtl_relay --relay ws://your-server:8080 --device 0
Flag Default Description
--relay ws://rtl-relay.com:8080 Relay server WebSocket URL
--device 0 RTL-SDR device index

The client prints the public endpoint to share with listeners.

Connecting as a Listener

Point any rtl_tcp-compatible SDR software to the endpoint:

rtl-relay.com:20000

The first user to connect becomes the controller (can tune frequency/gain). Additional users are viewers (I/Q only).

Features

  • Multi-user relay — one dongle, many simultaneous listeners
  • Controller/viewer model — first user controls tuning and gain
  • Auto-reconnect — exponential backoff on connection loss
  • Standard rtl_tcp protocol — no special client software needed
  • Cross-platform — single Go binary for Linux amd64 / arm64

Building from Source

Requires Go 1.24+ and librtlsdr development headers.

git clone https://github.com/sarahroselives/rtl_relay
cd rtl_relay
go build -o rtl_relay .

For ARM64 cross-compilation:

CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -o rtl_relay_linux_arm64 .

Pre-built Binaries

Linux amd64 and arm64 binaries are available at rtl-relay.com/dl/.

Bandwidth

Raw IQ data rate at common sample rates:

Sample Rate Upload
512 kSPS ~8 Mbps
1.024 MSPS ~16 Mbps
2.048 MSPS ~33 Mbps

This is per-listener outbound from the relay server. Lower sample rates save bandwidth without sacrificing WFM quality — FM broadcast is 200 kHz wide and works well at 512 kSPS.

Dependencies

License

GPL-2.0