Skip to main content
Version: 3.20.0

Stream Routes

In this document, you will learn the basic concept of stream routes in APISIX and why you may need them.

Explore additional resources at the end of the document for more information on related topics.

Overview​

In APISIX, a stream route object is used to create a route when APISIX functions as a stream proxy, operating on the transport layer for TCP and UDP connections. This is analogous to the concept of routes in cases where APISIX functions as an application-layer proxy.

The following diagram shows two clients connecting to APISIX at 192.168.1.10:9500. The stream route uses remote_addr to match connections from 192.168.40.3, then proxies them to the MySQL upstream:

A client at 192.168.40.3 matches a Stream Route and connects through APISIX to a MySQL upstream; another client does not match

A stream listener accepts TCP or UDP connections, while a stream route matches those connections and selects an upstream. A stream route can distinguish connections by client address, listener address or port, and TLS server name. Depending on the listener setup, APISIX can terminate TLS or pass the encrypted connection through to the upstream. Creating a stream route does not create or expose a listener.

For configuration examples, see Proxy Transport Layer (L4) Traffic. For the complete resource schema, see the Admin API reference for stream routes.

Additional Resources​