(config string, exclude []string)
| 814 | } |
| 815 | |
| 816 | func NewConfig(config string, exclude []string) (*Config, error) { |
| 817 | var xrayConfig Config |
| 818 | err := json.Unmarshal([]byte(config), &xrayConfig) |
| 819 | if err != nil { |
| 820 | return nil, err |
| 821 | } |
| 822 | |
| 823 | for _, i := range xrayConfig.InboundConfigs { |
| 824 | if i.clients == nil { |
| 825 | i.clients = make(map[string]api.Account) |
| 826 | } |
| 827 | if slices.Contains(exclude, i.Tag) { |
| 828 | i.mu.Lock() |
| 829 | i.exclude = true |
| 830 | i.mu.Unlock() |
| 831 | } |
| 832 | } |
| 833 | |
| 834 | return &xrayConfig, nil |
| 835 | } |
no outgoing calls