fix(kcp): enable congestion control, add FEC, and fix remote node UDP diagnosis

- KCP: switch from fast3 to fast2 mode, enable FEC (10/3), enable
  congestion control (nc=0) for automatic rate adaptation
- go-gost/x: support kcp.nc metadata to override mode-initialized
  NoCongestion value in dialer and listener Init()
- Diagnosis: add udpPingViaRemoteNode, fix pingViaRemoteNode to
  dispatch based on protocol, add Protocol field to federation
  diagnose request structs
This commit is contained in:
sagitchu
2026-04-21 15:41:32 +08:00
parent 30e1473f06
commit c1bc795674
6 changed files with 66 additions and 19 deletions
+11 -5
View File
@@ -86,10 +86,11 @@ type federationRuntimeReleaseRoleRequest struct {
}
type federationRuntimeDiagnoseRequest struct {
IP string `json:"ip"`
Port int `json:"port"`
Count int `json:"count"`
Timeout int `json:"timeout"`
IP string `json:"ip"`
Port int `json:"port"`
Count int `json:"count"`
Timeout int `json:"timeout"`
Protocol string `json:"protocol"`
}
type federationRuntimeCommandRequest struct {
@@ -1281,7 +1282,12 @@ func (h *Handler) federationRuntimeDiagnose(w http.ResponseWriter, r *http.Reque
commandTimeout = diagnosisCommandTimeout
}
res, err := h.sendNodeCommandWithTimeout(share.NodeID, "TcpPing", map[string]interface{}{
commandType := "TcpPing"
if isUDPBasedProtocol(req.Protocol) {
commandType = "UdpPing"
}
res, err := h.sendNodeCommandWithTimeout(share.NodeID, commandType, map[string]interface{}{
"ip": req.IP,
"port": req.Port,
"count": req.Count,