relay_server_rs/README.md
2026-07-02 15:10:48 +08:00

1.1 KiB

relay_server

Rust QUIC implementation of the RelayKit TCP relay server.

Each QUIC connection replaces the old UDP peer. Each QUIC bidirectional stream replaces the old stream_id and maps to one outbound TCP connection. QUIC provides ordered stream delivery and connection encryption, so the old UDP frame header encryption is intentionally not present.

Run

cargo run -- config.toml.example

The server also reads the config path from RELAY_SERVER_CONFIG. If neither is provided and config.toml does not exist, built-in defaults are used.

Stream Protocol

The client opens a QUIC bidirectional stream and writes one open request using the old binary payload format:

host_len(2), host(host_len), port(2),
username_len(2), username(username_len),
password_len(2), password(password_len)

All integers are unsigned big-endian values. After authentication and a successful TCP connect, the server writes:

0

Then both sides relay raw TCP bytes over the QUIC stream. On failure, the server writes:

1, error_len(2), error(error_len)