mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-03 03:35:04 +03:00
feat(xray): accept the TUN WFP leak ports of xray-core 26.10.31
xray-core 26.10.31 (#7288) widened a TUN inbound's autoSystemWfpBlockLeak: "dns" now also blocks DNS over TLS/QUIC (port 853), "windnsclient" covers only Windows' DNS Client service, and any "tcp/<port>" or "udp/<port>" keeps that port inside the TUN. Anything else, such as "tcp/0" or "icmp/1", stops the core at startup. The form offers windnsclient and takes typed port values, the hint explains them in all 14 locales, and the inbound and template save paths run the core's own ExpandWfpBlockLeak so a value it refuses is refused at save instead of taking every inbound down.
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/database/model"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/util/common"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/util/version"
|
||||
"github.com/mhsanaei/3x-ui/v3/internal/xray"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -161,3 +162,21 @@ func streamSupportsFallbacks(streamSettings string) bool {
|
||||
}
|
||||
return stream.Security == "tls" || stream.Security == "reality"
|
||||
}
|
||||
|
||||
// validateTunWfpBlockLeak refuses at save the autoSystemWfpBlockLeak values xray-core 26.10.31
|
||||
// (#7288) refuses when the core starts, which stops every inbound with it.
|
||||
func validateTunWfpBlockLeak(protocol, settings string) error {
|
||||
if protocol != "tun" {
|
||||
return nil
|
||||
}
|
||||
var tunSettings struct {
|
||||
AutoSystemWfpBlockLeak []string `json:"autoSystemWfpBlockLeak"`
|
||||
}
|
||||
if json.Unmarshal([]byte(settings), &tunSettings) != nil {
|
||||
return nil
|
||||
}
|
||||
if err := xray.ValidateTunWfpBlockLeak(tunSettings.AutoSystemWfpBlockLeak); err != nil {
|
||||
return common.NewError("TUN autoSystemWfpBlockLeak: ", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user