mirror of
https://github.com/fatedier/frp.git
synced 2026-04-05 08:39:17 +08:00
xtcp: when connection timeout occurs, support fallback to STCP (#3460)
This commit is contained in:
@@ -85,11 +85,6 @@ func ClassifyNATFeature(addresses []string, localIPs []string) (*NatFeature, err
|
||||
}
|
||||
}
|
||||
|
||||
natFeature.PortsDifference = portMax - portMin
|
||||
if natFeature.PortsDifference <= 10 && natFeature.PortsDifference >= 1 {
|
||||
natFeature.RegularPortsChange = true
|
||||
}
|
||||
|
||||
switch {
|
||||
case ipChanged && portChanged:
|
||||
natFeature.NatType = HardNAT
|
||||
@@ -104,6 +99,12 @@ func ClassifyNATFeature(addresses []string, localIPs []string) (*NatFeature, err
|
||||
natFeature.NatType = EasyNAT
|
||||
natFeature.Behavior = BehaviorNoChange
|
||||
}
|
||||
if natFeature.Behavior == BehaviorPortChanged {
|
||||
natFeature.PortsDifference = portMax - portMin
|
||||
if natFeature.PortsDifference <= 5 && natFeature.PortsDifference >= 1 {
|
||||
natFeature.RegularPortsChange = true
|
||||
}
|
||||
}
|
||||
return natFeature, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user