divert_tcp

This escaper will redirect all streams to a next proxy server by sending a PROXY Protocol V2 message first.

The PPv2 Type-Values are:

  • 0xE0 | Upstream Address

    The target upstream address, encoded in UTF-8 without trailing ‘0’. This will always be set. And the next proxy server should connect to this upstream address.

  • 0xE1 | TLS Verify Name

    The TLS verify name, encoded in UTF-8 without trailing ‘0’. This will be set only if the TLS handshake is started on our side.

  • 0xE2 | Username

    The username of the client, encoded in UTF-8 without trailing ‘0’. This will be set only if client auth is enabled on our side.

  • 0xE3 | Task ID

    The task id in UUID binary format. This will always be set.

The following interfaces are supported:

  • tcp connect

  • http(s) forward

There is no path selection support for this escaper.

The following common keys are supported:

proxy_addr

required, type: upstream str | seq

Set the target proxy address. The default port is 3128 which can be omitted.

For seq value, each of its element must be weighted upstream addr.

proxy_addr_pick_policy

optional, type: selective pick policy

Set the policy to select next proxy address.

The key for ketama/rendezvous/jump hash is <client-ip>[-<username>]-<upstream-host>.

default: random

bind_ipv4

optional, type: ipv4 addr str

Set the bind ip address for inet sockets.

default: not set

bind_ipv6

optional, type: ipv6 addr str

Set the bind ip address for inet6 sockets.

default: not set

tcp_keepalive

optional, type: tcp keepalive

Set tcp keepalive.

The tcp keepalive set in user config won’t be taken into account.

default: no keepalive set