The changes are limited to the server side, which generates and sends the Proxy Protocol header on data channel. The downstream server must be capable of parsing / handling the proxy protocol header.
Alternatively, an additional proxy protocol unwrapping server (for eg. go-mmproxy) could be setup on the client side. In this setup, rathole client's local_addr would point to the go-mmproxy, and go-mmproxy would in turn point to the actual downstream server.
Change log:
Added a new boolean field (enable_proxy_protocol) to ServerServiceConfig.
Added logic to generate the Proxy Protocol v1 header from TCP Stream.
If the enable_proxy_protocol is set as true, the proxy protocol header is written to data channel and flushed, before remainder of downstream protocol specific communication begins.
Example for enabling proxy protocol for a service.
Future enhancements:
Support Proxy Protocol v2.
Perhaps include the go-mmproxy style source IP spoofing logic on the client side to eliminate the needs for special setup on downstream server / go-mmproxy.
Adding support for Proxy Protocol V1.
The changes are limited to the server side, which generates and sends the Proxy Protocol header on data channel. The downstream server must be capable of parsing / handling the proxy protocol header.
Alternatively, an additional proxy protocol unwrapping server (for eg. go-mmproxy) could be setup on the client side. In this setup, rathole client's
local_addr
would point to the go-mmproxy, and go-mmproxy would in turn point to the actual downstream server.Change log:
enable_proxy_protocol
) toServerServiceConfig
.enable_proxy_protocol
is set astrue
, the proxy protocol header is written to data channel and flushed, before remainder of downstream protocol specific communication begins.Future enhancements: