XTCP

Understand agents of type frpXTCP.

The configuration method of XTCP is very similar to STCP. But it will adopt P2P If successful, the subsequent traffic will not pass through the method of drilling holes for penetration FRPS, instead of direct communication, is no longer limited by the bandwidth of the server where FRPS is located.

Due to the fact that the success rate of drilling depends on the NAT type of the network, XTCP The availability and stability of cannot be guaranteed. When reliable connection is required, it is recommended to use STCP Substitution.

When the visitor is configured WhenkeepTunnelOpen=true, frpc We will regularly check if the tunnel is open. If not, we will try to create a tunnel by drilling a hole, which can always keep the tunnel open and avoid delays when connecting to the opposite service.

By default, the visitor After receiving the user's connection, the program will attempt to make a hole. If the hole fails, multiple attempts can be made to establish the connection. The program will try other hole making strategies, and it is possible to successfully make a hole after multiple retries. Once the hole is successfully drilled, subsequent new connections do not need to be drilled repeatedly, but can reuse the tunnel.

Fallback mechanism

Can be accessed through Configuration fallback to stcp visitor Implement a rollback to STCP to establish a connection when drilling fails.

ExampleConfiguration:

[[visitors]]
    name = "stcp-visitor"
    type = "stcp"
    serverName = "stcp-test"
    secretKey = "abc"
    bindPort = -1
    
    [[visitors]]
    name = "xtcp-visitor"
    type = "xtcp"
    serverName = "xtcp-test"
    secretKey = "abc"
    bindAddr = "127.0.0.1"
    bindPort = 9002
    fallbackTo = "stcp-visitor"
    fallbackTimeoutMs = 200
    

When the connection127.0.0.1:9002exceeds 200ms P2P If the drilling is not successful yet, it will fall back to Use stcp visitor to establish a connection. Fallback Afterwards, the previously triggered hole drilling operation will still continue, and generally speaking, the time required to complete the hole drilling will be relatively long.

If the hole is successfully drilled, the next time a new connection is established, there will be no need to drill a hole again, and the connection will be established quickly without triggering it Fallback.

It is necessary to pay attention to setting the timeout time reasonably based on the delay situation of the accessing and being accessed ends, in order to avoid the timeout time being too short, even if the hole is successfully drilled and the connection is not established in time, and it will be triggered continuously Fallback.

Set thebindPortof stcp visitor to -1 Indicates that there is no need to listen to physical ports, only accept connections for fallback.

Last modified November 15, 2023: fix 404 (#71) (626ce4d)