mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
check number of socks servers
This commit is contained in:
parent
056084defd
commit
ac8d882a55
@ -27,11 +27,13 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {
|
||||
for _, rec := range config.Server {
|
||||
serverList.AddServer(protocol.NewServerSpecFromPB(*rec))
|
||||
}
|
||||
client := &Client{
|
||||
serverPicker: protocol.NewRoundRobinServerPicker(serverList),
|
||||
if serverList.Size() == 0 {
|
||||
return nil, newError("0 target server")
|
||||
}
|
||||
|
||||
return client, nil
|
||||
return &Client{
|
||||
serverPicker: protocol.NewRoundRobinServerPicker(serverList),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Process implements proxy.Outbound.Process.
|
||||
|
Loading…
Reference in New Issue
Block a user