1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-06-22 10:49:58 -04:00

check number of shadowsocks servers

This commit is contained in:
Darien Raymond
2017-04-11 13:42:10 +02:00
parent ac8d882a55
commit 8bb2d02f78

View File

@@ -28,6 +28,9 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {
for _, rec := range config.Server {
serverList.AddServer(protocol.NewServerSpecFromPB(*rec))
}
if serverList.Size() == 0 {
return nil, newError("0 server")
}
client := &Client{
serverPicker: protocol.NewRoundRobinServerPicker(serverList),
}