diff --git a/scagent/core/FileRpc.go b/scagent/core/FileRpc.go index 014e8f1..26cc96d 100644 --- a/scagent/core/FileRpc.go +++ b/scagent/core/FileRpc.go @@ -167,7 +167,7 @@ func clientUploadFile(remote string, filePath string, uploadPath string) error { // 连接到服务器 service := fmt.Sprintf("%v:%v", dstip, dport) fmt.Printf("service: %s\n", service) - conn, err := grpc.Dial(service, grpc.WithTransportCredentials(insecure.NewCredentials())) // 使用安全连接 + conn, err := grpc.NewClient(service, grpc.WithTransportCredentials(insecure.NewCredentials())) // 使用安全连接 // conn, err := grpc.NewClient(service) if err != nil { logger.Error("clientUploadFile", zap.String("msg", "无法连接到服务器"), zap.Error(err))