web/frps: more info (#3326)

This commit is contained in:
fatedier
2023-02-22 00:39:56 +08:00
committed by GitHub
parent fe8374e99b
commit 2f59e967a0
12 changed files with 136 additions and 66 deletions

View File

@@ -154,6 +154,8 @@ type ServerCommonConf struct {
// If the length of this value is 0, all ports are allowed. By default,
// this value is an empty set.
AllowPorts map[int]struct{} `ini:"-" json:"-"`
// Original string.
AllowPortsStr string `ini:"-" json:"-"`
// MaxPoolCount specifies the maximum pool size for each proxy. By default,
// this value is 5.
MaxPoolCount int64 `ini:"max_pool_count" json:"max_pool_count"`
@@ -259,6 +261,7 @@ func UnmarshalServerConfFromIni(source interface{}) (ServerCommonConf, error) {
for _, port := range allowPorts {
common.AllowPorts[int(port)] = struct{}{}
}
common.AllowPortsStr = allowPortStr
}
// plugin.xxx

View File

@@ -134,6 +134,7 @@ func Test_LoadServerCommonConf(t *testing.T) {
12: {},
99: {},
},
AllowPortsStr: "10-12,99",
MaxPoolCount: 59,
MaxPortsPerClient: 9,
TLSOnly: true,