Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for setting custom udp listen port on the xtcp mode #4681

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

zjay1987
Copy link

Enhancing xtcp Connectivity with UDP Port Forwarding

When your home router’s NAT traversal (hole punching) doesn’t work well—such as when it operates in Symmetric NAT mode only—you can configure a UDP port forwarding rule on the router as a workaround. For example:

Router Configuration

UDP 9999 → {Your-LAN-IP}:9999

frpc Configuration

[[visitors]]
name = "..."
type = "xtcp"
serverName = "..."
secretKey = "..."
bindAddr = "..."
bindPort = "..."
udpListen = "0.0.0.0:9999"

With this setup, frpc will use UDP port 9999 for communication with the STUN server instead of selecting a random port. Since port 9999 on the router is already configured to forwarded all traffics to {Your-LAN-IP}:9999, the likelihood of establishing a successful xtcp connection increases significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant