Meow
2026-05-07 19:10:48 +08:00
committed by RPRX
parent 906d49a271
commit c42deab55c
14 changed files with 75 additions and 42 deletions
+8 -3
View File
@@ -29,6 +29,7 @@ const (
type SocksServerConfig struct {
AuthMethod string `json:"auth"`
Users []*SocksAccount `json:"users"`
Accounts []*SocksAccount `json:"accounts"`
UDP bool `json:"udp"`
Host *Address `json:"ip"`
@@ -47,9 +48,13 @@ func (v *SocksServerConfig) Build() (proto.Message, error) {
config.AuthType = socks.AuthType_NO_AUTH
}
if len(v.Accounts) > 0 {
config.Accounts = make(map[string]string, len(v.Accounts))
for _, account := range v.Accounts {
if v.Accounts != nil {
v.Users = v.Accounts
}
// TODO: PB
if len(v.Users) > 0 {
config.Accounts = make(map[string]string, len(v.Users))
for _, account := range v.Users {
config.Accounts[account.Username] = account.Password
}
}