首页 > 解决方案 > 通过企业网络中的防火墙解锁以访问 Google Translate API(高级版)需要哪些 url?

问题描述

通过企业网络中的防火墙解锁以访问 Google Translate API(高级版)需要哪些 url?

目前解锁的是: *.googleapis.com 和 accounts.google.com

但我仍然得到以下错误: System.Reflection.TargetInvocationException:调用的目标已引发异常。---> Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="连接所有地址失败", DebugException="Grpc.Core.Internal.CoreErrorDetailException: {​​​​​​​​​" ;created":"@1612337108.132000000","description":"选择子频道失败","file":"T:\src\github\grpc\workspace_csharp_ext_windows_x64\src\core\ext\filters\client_channel\client_channel.cc" ,"file_line":4090,"referenced_errors":[{​​​​​​​​​"created":"@1612337108.132000000","description":"连接所有地址失败","file":"T :2.UnaryCall(TRequest msg) at Grpc.Core.DefaultCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method2 方法,字符串主机,CallOptions 选项,TRequest 请求)在 Grpc.Core.Interceptors.InterceptingCallInvoker.b__3_0[TRequest,TResponse](TRequest req,ClientInterceptorContext 2 ctx) at Grpc.Core.ClientBase.ClientBaseConfiguration.ClientBaseConfigurationInterceptor.BlockingUnaryCall[TRequest,TResponse](TRequest request, ClientInterceptorContext2 上下文,BlockingUnaryCallContinuation 2 continuation) at Grpc.Core.Interceptors.InterceptingCallInvoker.BlockingUnaryCall[TRequest,TResponse](Method2 方法,字符串主机,CallOptions 选项,TRequest 请求)在谷歌.Cloud.Translate.V3.TranslationService.TranslationServiceClient.TranslateText(TranslateTextRequest request, CallOptions options) at Google.Api.Gax.Grpc.ApiCall.GrpcCallAdapter 2.CallSync(TRequest request, CallSettings callSettings) at Google.Api.Gax.Grpc.ApiCallRetryExtensions.<>c__DisplayClass1_02.b__0(TRequest request, CallSettings callSettings) at ABG.Foundation.LanguageTranslator.GoogleTranslator。 TranslateData(String sourceLanguage, String targetLanguage, List 1 content) in D:\a\1\s\src\Foundation\LanguageTranslator\code\GoogleTranslator\GoogleTranslator.cs:line 106 at ABG.Foundation.LanguageTranslator.GoogleTranslator.TranslateData(List1 items, String sourceLanguage, String targetLanguage) in ...

注意:相同的代码和设置在公司网络之外也能正常工作。

标签: google-translator-toolkit

解决方案


推荐阅读