这一套逻辑已经完美对齐 V2bX!

This commit is contained in:
CN-JS-HuiBai
2026-04-15 01:38:41 +08:00
parent f8bffcd4a4
commit f6c02cc118

View File

@@ -129,8 +129,7 @@ type XInnerConfig struct {
Port int `json:"port"`
ServerPort int `json:"server_port"`
Protocol string `json:"protocol"`
Settings json.RawMessage `json:"settings"`
StreamSettings json.RawMessage `json:"streamSettings"`
NodeType string `json:"node_type"`
Cipher string `json:"cipher"`
ServerKey string `json:"server_key"`
TLS int `json:"tls"`
@@ -138,8 +137,11 @@ type XInnerConfig struct {
TLSSettings *XTLSSettings `json:"tls_settings"`
TLSSettings_ *XTLSSettings `json:"tlsSettings"`
Network string `json:"network"`
NetworkSettings json.RawMessage `json:"network_settings"`
NetworkSettings json.RawMessage `json:"network_settings"`
NetworkSettings_ json.RawMessage `json:"networkSettings"`
StreamSettings json.RawMessage `json:"streamSettings"`
UpMbps int `json:"up_mbps"`
DownMbps int `json:"down_mbps"`
}
type HttpNetworkConfig struct {
@@ -451,11 +453,16 @@ func (s *Service) setupNode() error {
// Resolve protocol
protocol := inner.Protocol
if protocol == "" {
protocol = config.NodeType
protocol = inner.NodeType
}
if protocol == "" {
protocol = config.NodeType_
protocol = config.NodeType
}
if protocol == "" && inner.Cipher != "" {
// Fallback for shadowsocks where protocol might be missing but cipher is present
protocol = "shadowsocks"
}
if protocol == "" {
s.logger.Error("Xboard setup error: could not identify protocol. Please check debug logs for raw JSON.")
return fmt.Errorf("unsupported protocol: empty")