Skip to content

[Feature Request] Add Auto Transport Mode with IPv4/IPv6 endpoint probing #5292

@ming79486

Description

@ming79486

Describe the feature request

Add an Auto Transport Mode for frp so that frpc can automatically select the best transport protocol when connecting to frps.

When both sides enable:

transport.protocol = "auto"

frps advertises available transport endpoints, such as:

  • TCP
  • KCP
  • QUIC
  • WebSocket
  • WSS

frpc then probes the available candidates and selects the best working transport automatically.

Expected behavior:

  • frpc starts with a bootstrap connection to frps.
  • frps returns supported transport endpoints and ports.
  • frpc probes candidate protocols.
  • frpc selects the best available protocol.
  • If the current control session fails, frpc can reselect another available transport.
  • If transport.proxyURL is configured, auto mode should only use TCP.

IPv4 / IPv6 probing:

If serverAddr is a domain name, frpc should resolve both A and AAAA records.

For each candidate protocol, frpc should test both IPv4 and IPv6 addresses when available, for example:

  • tcp@IPv4:7000
  • tcp@IPv6:7000
  • quic@IPv4:7002
  • quic@IPv6:7002

The final selection should use the fastest working route.

Example server config:

bindPort = 7000
kcpBindPort = 7000
quicBindPort = 7002

transport.protocol = "auto"
transport.auto.enabled = true
transport.auto.advertiseProtocols = ["tcp", "kcp", "quic", "websocket", "wss"]

Example client config:

serverAddr = "example.com"
serverPort = 7000

transport.protocol = "auto"
transport.auto.enabled = true
transport.auto.candidates = ["quic", "tcp", "wss", "websocket", "kcp"]

This would make frp more adaptive across different networks, especially where UDP, QUIC, IPv4, or IPv6 availability varies by environment.

Describe alternatives you've considered

https://github.com/ming79486/frp

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions