googleapis / nodejs-storage

Node.js client for Google Cloud Storage: unified object storage for developers and enterprises, from live data serving to data analytics/ML to data archiving.
https://cloud.google.com/storage/
Apache License 2.0
888 stars 368 forks source link

How to specify proxy directly on the client? #2398

Closed az-nextsec closed 4 months ago

az-nextsec commented 5 months ago

I have a specific sequence of Google Cloud Storage calls that seem to fail and the errors caught are inside the GRPC client saying precondition fail even though I know I did not specify any preconditions in the requests that do fail.

Now I figured I could run my nodejs app through the proxy to see the requests that fail. Unfortunately, my issue is to do with the timing as I am using Pub/Sub pull subscription and the issue only happens when multiple messages are processed concurrently.

Unfortunately if I use HTTP_PROXY/HTTPS_PROXY (and with/without grpc_proxy) I never get any messages on my pub sub client; that said my Storage calls are proxied correctly.

How can I set the HTTPS proxy for Cloud storage client only without setting it also for Pub/Sub client?

ddelgrosso1 commented 5 months ago

Hi @az-nextsec unfortunately at this time we do not have a way to set proxies other than the way you noted (environment variables). I'm not sure if pub/sub has the ability to manually set / override environment variables.