Skip to content

grpc_proxy connection issue in @grpc/[email protected] #2932

@hhsnow

Description

@hhsnow

Problem description

When using a grpc_proxy with @grpc/[email protected], connections to vision.googleapis.com fail to establish. No issue with @grpc/[email protected].

Reproduction steps

create a grpc request to vision.googleapis.com over squid proxy (6.x).

$> npm install @google-cloud/vision

import {ImageAnnotatorClient} from '@google-cloud/vision';
import {readFile} from 'fs/promises';

process.env.GOOGLE_APPLICATION_CREDENTIALS = './credentials.json';
process.env.grpc_proxy = "http://proxy:port";

const visionClient = new ImageAnnotatorClient();
const imageBuffer = await readFile('./image.jpg');

const [response] = await visionClient.textDetection({image: {content: imageBuffer.toString('base64')}});
console.log(response);

By default @grpc/[email protected] is installed as a dependency. The code above will loop for 10 minutes making connection attempts to the proxy service.

$> npm i @grpc/[email protected]
Downgrading to 1.12.6 allows the connection over proxy to succeed as expected.

Environment

  • MacOS 15.3/Alpine Linux 3.20
  • 20/22
  • node:alpine-20 image, homebrew.
  • @grpc/[email protected]

Additional context

Looks like a workaround for TLS proxying over http proxy was removed between 1.12.6 and 1.13.0, perhaps related? #1369

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions