frps端同步frpc2.4-LTS的全套代码库的设计逻辑
This commit is contained in:
+3
-9
@@ -13,13 +13,11 @@ type FrpsToml struct {
|
||||
Token string `json:"token"`
|
||||
} `json:"auth"`
|
||||
Log struct {
|
||||
To string `json:"to"`
|
||||
Level string `json:"level"`
|
||||
MaxDays int `json:"maxDays"`
|
||||
} `json:"log"`
|
||||
Transport struct {
|
||||
TcpMux bool `json:"tcpMux"`
|
||||
WireProtocolV2 bool `json:"wireProtocolV2"`
|
||||
TcpMux bool `json:"tcpMux"`
|
||||
} `json:"transport"`
|
||||
}
|
||||
|
||||
@@ -27,11 +25,9 @@ func ParseToml(content string) (*FrpsToml, error) {
|
||||
lines := strings.Split(content, "\n")
|
||||
result := &FrpsToml{
|
||||
Transport: struct {
|
||||
TcpMux bool `json:"tcpMux"`
|
||||
WireProtocolV2 bool `json:"wireProtocolV2"`
|
||||
TcpMux bool `json:"tcpMux"`
|
||||
}{
|
||||
TcpMux: true,
|
||||
WireProtocolV2: false,
|
||||
TcpMux: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -63,8 +59,6 @@ func ParseToml(content string) (*FrpsToml, error) {
|
||||
result.Log.MaxDays, _ = strconv.Atoi(value)
|
||||
case "tcpMux":
|
||||
result.Transport.TcpMux = value == "true"
|
||||
case "wireProtocol":
|
||||
result.Transport.WireProtocolV2 = value == "v2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user