OpenResty Edge supports as a TCP proxy service to forward traffic on TCP Layer.
By default the Edge does not listen any ports for TCP proxy, you need to enable the required TCP proxy port in the global configuration page.
We go to the
Global Configuration =>
Gateway Network Partitions page and we can see all the partitions and the different types of ports they have listening.
We can edit a partition to configure the required ports.
We click on "Add port" and enter the port that we needed, choosing
tcp as the port type.
Click on save and we will see the port in the current list. At this point the gateway node in this partition will be listening on this port now.
We now go to
Stream, where we can see the applications of the Stream type that have been created.
Click on New Application, select
TCP as the type, enter the port we just added (also can add more ports), click Save and a TCP proxy application is created.
After creating the application, the next step is to configure the proxy forwarding rules. We need to create the upstream first, and on the upstream page we can see the button to add an upstream.
Click on it to add an upstream, enter the name of the upstream, and the address and port information of the upstream node.
Click on save and the upstream is created.
Next, go to the pre-processing stage and click on New rule, we need to create a proxy rule.
We turn on the proxy and select the proxy to the newly created upstream.
Click on save and the new forwarding rule is created. Next, we need to publish the configuration changes that we have just made. When we go to the publish page, we can see the pending changes that have not yet been released.
By clicking on the release button, you can optionally enter some notes and then click on release. Soon these configurations are synchronised to the gateway nodes in the partition and a TCP proxy service is already running.