Stream Proxy
TCP is the protocol for many popular applications and services, such as LDAP, MySQL, and RTMP. UDP (User Datagram Protocol) is the protocol for many popular non-transactional applications, such as DNS, syslog, and RADIUS.
APISIX can dynamic load balancing TCP/UDP proxy. In Nginx world, we call TCP/UDP proxy to stream proxy, we followed this statement.
How to enable Stream proxy?#
Setting the stream_proxy option in conf/config.yaml, specify a list of addresses that require dynamic proxy.
By default, no any stream proxy is enabled.
How to set route?#
Here is a mini example:
It means APISIX will proxy the request to 127.0.0.1:1995 which the client remote address is 127.0.0.1.
For more use cases, please take a look at test case.
More Limit Options#
And we can add more limit options to match a route, here is an example:
It means APISIX will proxy the request to 127.0.0.1:1995 which the server remote address is 127.0.0.1 and the server port is equal 2000.