3.2 KiB
TCP and UDP Streams
The Streams workspace forwards non-HTTP TCP or UDP traffic through dedicated sockets. It is separate from Vhost HTTP routing. Suitable examples include selected private TCP application ports and UDP protocols that need basic forwarding rather than HTTP features.
Configure a Stream
- Open Streams → Add and choose
TCPorUDP, a unique name/ID and enabled state. - Set the listening IP/port and an upstream address, or configure a backend pool.
- If using several backends, select weights, balancing, health checks and draining appropriately.
- Configure connection/session limit, TCP connect timeout and idle timeout.
- Save, restart RustProxy if the listener change requires it, then test with a real client and inspect Stream metrics.
The source model supports a legacy single-upstream configuration or a backend list (up to the validated per-host limit), with pool-based load balancing and health observations. Do not assume HTTP health-check response codes can be applied to a UDP-only application: use the probe options actually supported by the Stream type.
The stream editor has the tabs Details, Listener & upstream, Backends, Health and Limits. Backends are rows of a table (state, name, weight, address, live health and sessions, chips for drain, session limit, health check and detail metrics); an expanded row holds the connection and capacity fields and can be copied or removed. The Health tab holds the health check of every backend. The stream card shows the state (running, pending restart, disabled), protocol, health summary, limits and per-backend health. The backend editor groups connection/capacity settings separately from active health-check options. When Health checks is Off, probe tuning fields are hidden; selecting TCP connect/UDP probe reveals them without erasing their values. Hidden fields are excluded from browser validation.
Behavior and boundaries
- TCP forwards a bidirectional byte stream. The proxy does not interpret application messages or terminate application TLS.
- UDP maintains bounded per-client forwarding sessions; datagrams and inactivity timeouts behave differently from TCP connections.
- Not available: HTTP Vhost routing, Host/path matching, HTTP cookies, WebSocket logic, shared HTTP cache, HTTP Basic/Tinyauth, HTTP header rules or frontend HTTP/3/TLS termination. Protect these endpoints with firewall rules and protocol-specific backend authentication/encryption.
- Listeners and backend IP/ports must be concrete, valid and nonconflicting with other RustProxy/admin/exporter sockets. Resource limits and network policy still apply.
Status and testing
Stream views/Overview include sessions, connections, traffic, rejected/errors and backend health/capacity when enabled. Counter reset or no-data state after service restart is normal.
Run end-to-end client traffic through the configured Stream listener in an isolated test network. Verify data transfer, idle timeouts and backend failover for the selected protocol.
If clients cannot connect, inspect listen IP/port, host firewall, TCP vs UDP selection, routing to the chosen backend, backend health and stream logs. See Security and Monitoring.