0

회사의 방화벽 내에서 내 프로젝트에서 작동하도록 Google 음성 API를 구성하려고합니다. 다음과 같이 SpeechSettings를 구성했습니다.Google 음성 API 자격 증명에 대한 프록시 인증

InputStream is = this.getClass().getResourceAsStream("/my-service-account.json");   
CredentialsProvider credentialsProvider = FixedCredentialsProvider.create(ServiceAccountCredentials.fromStream(is)); 
SpeechSettings.Builder builder = SpeechSettings.newBuilder(); 
builder.setTransportProvider(SpeechSettings.defaultTransportProvider()); 
builder.setCredentialsProvider(credentialsProvider); 
SpeechSettings settings = builder.build(); 
SpeechClient.create(settings); 

이 방법은 프록시 네트워크 외부에서 올바르게 작동하고 음성 인식 세션을 시작합니다. 그러나 그것은 프록시 인증 네트워크에서 아무 것도 기록하지 못하고 ApiStreamObserver 클래스의 UNAVAILABLE: Transport closed for unknown reason 오류로 시간 초과됩니다. 방화벽 시간 초과 때문에 Grpc 전송이 닫히고 있다고 생각합니다.

음성 클라이언트 세션을 만드는 동안 프록시 인증 자격 증명으로 인증하는 것이 가능합니까? 감사.

답변

0

사용중인 프록시 네트워크를 명확히 할 수 있습니까? Google Cloud Endpoints (https://cloud.google.com/endpoints)를 사용하고 계십니까? 프로젝트가 Google Cloud Platform에서 실행되고 있습니까? 그렇다면 특정 플랫폼은 무엇입니까? App Engine Flex? App Engine 표준? Compute Engine? 컨테이너 엔진?

+0

프록시 네트워크는 사용자 이름과 암호가있는 http 프록시입니다. Google Cloud Platform에서 엔드 포인트를 사용하거나 프로젝트를 실행하지 않습니다. API와 연결하려면 서비스 계정 json 파일을 사용해야합니다. – swapp1990

+0

몇 가지 연구를 한 후이 게시물에서 프록시를 설정하는 방법을 찾았습니다 : https://github.com/grpc/grpc-java/issues/2983. 환경 변수 GRPC_PROXY_EXP를 프록시 url : my.proxy.com:8080으로 설정하면 작동합니다! – swapp1990

관련 문제