Stream Hosts#

Stream hosts provide Layer 4 (TCP/UDP) port forwarding via Caddy’s caddy-l4 plugin. Unlike proxy hosts, stream hosts do not understand HTTP — they forward raw byte streams.

When to use stream hosts#

  • Forwarding a database port (PostgreSQL, MySQL, Redis) through the server
  • Forwarding non-HTTP connections to a single upstream
  • Transparent forwarding where the application manages its own TLS

For HTTP/HTTPS traffic, use Proxy Hosts instead. For encrypted traffic that must not be decrypted, use TLS Passthrough on a proxy host.

Creating a stream host#

  1. Click Traffic Forwarding in the sidebar (the former Stream Hosts URL redirects here)
  2. Click + Add Rule
  3. Fill in the form:
FieldDescription
Incoming PortThe port on this server to listen on
Forward HostDestination host or IP
Forward PortDestination port
Protocoltcp, udp, or tcp+udp
SNI Match(Optional) Only match streams with this SNI hostname
  1. Click Create
Add Forwarding Rule form mapping TCP port 15432 to 192.0.2.30 port 5432

The current Traffic Forwarding editor, with an unsaved TCP example. No listener has been opened.

Protocol selection#

ProtocolUse case
tcpMost services: databases, SSH, HTTP (without parse), SMTP
udpDNS, game servers, VoIP, WireGuard
tcp+udpWhen a service uses both protocols on the same port

SNI matching#

If SNI Match is set, the TCP listener only matches TLS connections with that hostname in the ClientHello. This does not merge independent stream listeners with Caddy’s HTTPS listener. Use proxy-host TLS Passthrough for managed SNI routing alongside normal HTTPS on port 443.

Leave blank to accept all connections on the incoming port regardless of SNI.

Port conflicts#

Use an unused incoming port on the selected server. The current API validates port ranges but does not reliably reject all listener collisions before saving. Caddy can reject application after a conflicting rule has been saved. Correct or disable the rule and check configuration application status.

Avoid ports already used by the installation, including:

  • 80 and 443 are Caddy’s default HTTP/HTTPS listeners
  • 81 (or your configured management port) is the PosternProxy management UI
  • 2019 is Caddy’s local admin API

Open each incoming protocol/port in the host and cloud firewalls. See Traffic Forwarding for commands.

Caddy L4 plugin#

Stream hosts require the github.com/mholt/caddy-l4 plugin, which is included in the Caddy binary installed by posternproxy install.

Enable / disable#

Stream hosts can be enabled or disabled independently. Disabling removes the managed listener after successful configuration application. Check the configuration notice for rejection or offline agents.

PosternProxyQuick start →