frps端同步frpc2.4-LTS的全套代码库的设计逻辑

This commit is contained in:
2026-08-01 19:31:03 +08:00
parent ccdd5b0725
commit 3214215032
10 changed files with 988 additions and 455 deletions
+3 -9
View File
@@ -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"
}
}