mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-02 17:58:46 +00:00
Config: Rename inbounds' clients/accounts to users (#6083)
https://github.com/XTLS/Xray-core/pull/6055#issuecomment-4363896372 https://github.com/XTLS/Xray-core/pull/6082#issuecomment-4384523482
This commit is contained in:
+8
-3
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user