mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-10 06:19:55 +00:00
feat: unify trojan transport & add ss2022 related config (#465)
This commit is contained in:
parent
5fe18e020d
commit
71aba0601e
@ -21,11 +21,7 @@ type CustomConfig struct {
|
|||||||
OffsetPortNode string `json:"offset_port_node"`
|
OffsetPortNode string `json:"offset_port_node"`
|
||||||
ServerSub string `json:"server_sub"`
|
ServerSub string `json:"server_sub"`
|
||||||
Host string `json:"host"`
|
Host string `json:"host"`
|
||||||
MuPort string `json:"mu_port"`
|
Method string `json:"method"`
|
||||||
MuEncryption string `json:"mu_encryption"`
|
|
||||||
MuProtocol string `json:"mu_protocol"`
|
|
||||||
MuObfs string `json:"mu_obfs"`
|
|
||||||
MuSuffix string `json:"mu_suffix"`
|
|
||||||
V2Port string `json:"v2_port"`
|
V2Port string `json:"v2_port"`
|
||||||
TLS string `json:"tls"`
|
TLS string `json:"tls"`
|
||||||
EnableVless string `json:"enable_vless"`
|
EnableVless string `json:"enable_vless"`
|
||||||
@ -38,7 +34,6 @@ type CustomConfig struct {
|
|||||||
Header json.RawMessage `json:"header"`
|
Header json.RawMessage `json:"header"`
|
||||||
TrojanPort string `json:"trojan_port"`
|
TrojanPort string `json:"trojan_port"`
|
||||||
AllowInsecure string `json:"allow_insecure"`
|
AllowInsecure string `json:"allow_insecure"`
|
||||||
Grpc string `json:"grpc"`
|
|
||||||
Servicename string `json:"servicename"`
|
Servicename string `json:"servicename"`
|
||||||
EnableXtls string `json:"enable_xtls"`
|
EnableXtls string `json:"enable_xtls"`
|
||||||
Flow string `json:"flow"`
|
Flow string `json:"flow"`
|
||||||
|
@ -768,6 +768,7 @@ func (c *APIClient) ParseSSPanelNodeInfo(nodeInfoResponse *NodeInfoResponse) (*a
|
|||||||
}
|
}
|
||||||
|
|
||||||
parsedPort, err := strconv.ParseInt(nodeConfig.OffsetPortNode, 10, 32)
|
parsedPort, err := strconv.ParseInt(nodeConfig.OffsetPortNode, 10, 32)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -780,6 +781,7 @@ func (c *APIClient) ParseSSPanelNodeInfo(nodeInfoResponse *NodeInfoResponse) (*a
|
|||||||
if c.NodeType == "V2ray" {
|
if c.NodeType == "V2ray" {
|
||||||
transportProtocol = nodeConfig.Network
|
transportProtocol = nodeConfig.Network
|
||||||
TLSType = nodeConfig.Security
|
TLSType = nodeConfig.Security
|
||||||
|
|
||||||
if parsedAlterID, err := strconv.ParseInt(nodeConfig.AlterID, 10, 16); err != nil {
|
if parsedAlterID, err := strconv.ParseInt(nodeConfig.AlterID, 10, 16); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
@ -789,6 +791,7 @@ func (c *APIClient) ParseSSPanelNodeInfo(nodeInfoResponse *NodeInfoResponse) (*a
|
|||||||
if TLSType == "tls" || TLSType == "xtls" {
|
if TLSType == "tls" || TLSType == "xtls" {
|
||||||
EnableTLS = true
|
EnableTLS = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if nodeConfig.EnableVless == "1" {
|
if nodeConfig.EnableVless == "1" {
|
||||||
EnableVless = true
|
EnableVless = true
|
||||||
}
|
}
|
||||||
@ -807,9 +810,7 @@ func (c *APIClient) ParseSSPanelNodeInfo(nodeInfoResponse *NodeInfoResponse) (*a
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Select transport protocol
|
// Select transport protocol
|
||||||
if nodeConfig.Grpc == "1" {
|
if nodeConfig.Network != "" {
|
||||||
transportProtocol = "grpc"
|
|
||||||
} else if nodeConfig.Network != "" {
|
|
||||||
transportProtocol = nodeConfig.Network // try to read transport protocol from config
|
transportProtocol = nodeConfig.Network // try to read transport protocol from config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -827,7 +828,7 @@ func (c *APIClient) ParseSSPanelNodeInfo(nodeInfoResponse *NodeInfoResponse) (*a
|
|||||||
EnableTLS: EnableTLS,
|
EnableTLS: EnableTLS,
|
||||||
EnableVless: EnableVless,
|
EnableVless: EnableVless,
|
||||||
VlessFlow: nodeConfig.Flow,
|
VlessFlow: nodeConfig.Flow,
|
||||||
CypherMethod: nodeConfig.MuEncryption,
|
CypherMethod: nodeConfig.Method,
|
||||||
ServiceName: nodeConfig.Servicename,
|
ServiceName: nodeConfig.Servicename,
|
||||||
Header: nodeConfig.Header,
|
Header: nodeConfig.Header,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user