diff --git a/proxy/shadowsocks/client.go b/proxy/shadowsocks/client.go index 85f69044..8b78adaa 100644 --- a/proxy/shadowsocks/client.go +++ b/proxy/shadowsocks/client.go @@ -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), }