mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #4885] XTCP Health Check #3855
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#3855
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MahdiAkrami01 on GitHub (Jul 18, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4885
Bug Description
The issue is that when I use standard TCP, I can detect if the tunnel is down by checking a TCP ping. However, when using XTCP, the ports continue listening even if the tunnel is down, making it difficult to verify whether the tunnel is operational. I am using HAProxy with a simple TCP check. I have three tunnels:
The xtcp tunnel is always considered operational, even when the tunnel is down.
I know that I can set up complex health checks using HAProxy agents, but I think it's better to try fixing this in a simpler way.
frpc Version
0.63.0
frps Version
0.63.0
System Architecture
linux/amd64
Configurations
.
Logs
No response
Steps to reproduce
No response
Affected area
@fatedier commented on GitHub (Jul 21, 2025):
What do you think would be the appropriate way to handle this?
@MahdiAkrami01 commented on GitHub (Jul 21, 2025):
It must start listening only after the P2P tunnel is successfully connected
It should also stop listening if the tunnel is disconnected
Is it possible to make this happen in XTCP mode?
@fatedier commented on GitHub (Jul 21, 2025):
Tunnel establishment is generally delayed and only created when there is a new connection now.
@MahdiAkrami01 commented on GitHub (Jul 21, 2025):
Okay, so what about this:

Can you forward the TCP ping through the tunnel?
By doing that, when the tunnel is not established, the TCP ping will fail, and the health check will work correctly.
Because right now, I think FRPC is responding to the TCP ping locally instead of routing it through the tunnel.
In the image, the 74 ms is for the WireGuard tunnel, and the others are for XTCP.
@fatedier commented on GitHub (Jul 21, 2025):
xtcp is L4 proxy like nginx and haproxy. It works differently from WireGuard.
@MahdiAkrami01 commented on GitHub (Jul 21, 2025):
so the only way to bypass this is to use VirtualNet right?
is VirtualNet support xtcp mode?
@github-actions[bot] commented on GitHub (Aug 5, 2025):
Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.