Skip to main content

Version: 3.11.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 illustrates the concept of a stream route object. In this example, APISIX functions as a stream proxy for a MySQL server that uses TCP protocol for communication. APISIX is deployed at IP address 192.168.1.10 and configured to listen for TCP connections on port 9500:

APISIX and MySQL Server with one stream route restricting on client IP address

The client_addr field in the stream route filters on the client IP, ensuring that only requests originating from the specified IP address are allowed to pass through this route to the upstream MySQL server. While both clients have used the correct credentials to connect to the MySQL server, only the client with IP address whitelisted in client_addr is permitted to establish a connection.

In addition to the client_addr field, there are other fields such as server_addr and server_port that can be configured to filter incoming requests before rejecting or forwarding them to upstream services. To learn more about these fields and other configuration options, please refer to the Admin API reference for stream routes (coming soon).

For detailed instructions on how to configure APISIX as a stream proxy, see the Proxy Transport Layer (L4) Traffic how-to guide.

Additional Resource(s)


API7.ai Logo

API Management for Modern Architectures with Edge, API Gateway, Kubernetes, and Service Mesh.

Product

API7 Cloud

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN Ltd. 2019 – 2024. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the

Apache Software Foundation