nodejs-dialogflow icon indicating copy to clipboard operation
nodejs-dialogflow copied to clipboard

working from behind a http proxy

Open amitjagtap opened this issue 8 years ago • 23 comments

Environment details

  • OS: Windows 8
  • Node.js version: 8.1.1
  • npm version: 5.0.3
  • dialogflow version: 0.1.0

Steps to reproduce

  1. follow the steps mentioned on https://github.com/dialogflow/dialogflow-nodejs-client-v2
  2. create a file using the code specified here - https://github.com/dialogflow/dialogflow-nodejs-client-v2#using-the-client-library
  3. the above code works fine when the program has direct internet access; however when there is a http proxy, the following error is observed -

Debugger attached. ERROR: { Error: Connect Failed at ...\node_modules\grpc\src\client.js:554:15 code: 14, metadata: Metadata { _internal_repr: {} } }

There is no documented way to pass http proxy parameters to the API...

Thanks!

amitjagtap avatar Jan 20 '18 22:01 amitjagtap

I'm also running into this issue with [email protected]

Everything works perfectly fine when running locally just the second I try and run it within a Docker container, I'm getting:

Error Code 14: Connect Failed

callensm avatar Jan 22 '18 18:01 callensm

Hi, are you using REST or gRPC( uses http/2 ) ? There may be some issue using gRPC and http proxies, REST should be fine.

jliukai avatar Jan 23 '18 20:01 jliukai

@jliukai I'm using the grpc system and it looks like OP is as well based on his error

callensm avatar Jan 24 '18 15:01 callensm

I'm able to connect from behind a corporate proxy using the http_proxy environment variable.

https://github.com/grpc/grpc/blob/master/doc/environment_variables.md

hboylan avatar Jan 31 '18 16:01 hboylan

I am having the same issue; except the http_proxy environment variable is set, and not working. This is with dialogflow release version 0.5.0. The proxy is receiving a TLS CLIENT_HELLO message before a CONNECT request is initiated.

mephicide avatar Jul 23 '18 14:07 mephicide

@jliukai said:

Hi, are you using REST or gRPC( uses http/2 ) ?

How can I choose this configuration in my client code?

paulodfreitas avatar Aug 28 '18 21:08 paulodfreitas

I have a similar issue:

I have set the https_proxy env variable.

Also bit of a noob, so if anyone can help me interpret the logs, that will be of great help.

Complete verbose logs by setting GRPC_TRACE=all

https://gist.github.com/JustinBeckwith/039316dbb54531288371794cdacd4de2

mrPrateek95 avatar Sep 20 '18 11:09 mrPrateek95

Same issue

aybhalala avatar Feb 24 '19 01:02 aybhalala

Hey Team, This issue has been open for over a year with no resolution. There are many people who have seen this issue even after setting the correct proxy variables. Is there a path for resolution? In the nodejs library, is there any way to not use grpc and just use rest? Will opening a support ticket through corporate support help accelerate the resolution of this issue?

aybhalala avatar Feb 25 '19 18:02 aybhalala

@aybhalala this repo is specifically for the gRPC version, however you can use the google-api-nodejs-client if you need to use the REST version.

@bcoe @JustinBeckwith I'm not sure if there's anything actionable here for us? Seems like the correct solution is to use the https_proxy env var and if any issues exist around that, they're likely meant for either grpc or the auth library to solve?

callmehiphop avatar Jun 03 '19 20:06 callmehiphop

Hi everyone,

I am writing this comment to document how my team worked arround this issue.

As commented by @callmehiphop uses gRPC (HTTP/2), and we, probably, can't do much about this. The main point is the HTTP/2 is new and different protocol, not an extension to it HTTP. This means that our proxy server must be modified/update to support it, but it's not up to us do so.

Our solution was to host a HTTP service in a Cloud, outsite our main infrastrucure, that was able to use this package and make HTTP/2 normally. And from our code, inside our infrastrucure, we call this new service, with our old proxy.

This is clearly a poor solution, but still working well for us.

Hope it help and save time to who will arrive here.

paulodfreitas avatar Jun 05 '19 19:06 paulodfreitas

@amitjagtap as @callmehiphop indicates, this repo is specifically for our gRPC client, and REST is not an option.

Perhaps a good action item would be to dig into whether grpc-js can be made to work with a proxy, and to document the approach; I can bring up this topic when I talk with the gRPC team next week.

bcoe avatar Jun 07 '19 13:06 bcoe

.0.8.2 is the last version i can use successfully while using our corporate proxy with the https_proxy env variable

amammay avatar Jun 14 '19 16:06 amammay

Hi everyone, any news on this?

I also have the same issue, I can't make it work with a proxy. The http_proxy environment variable is set and I can't downgrade to version 0.8.2 (otherwise it does not build with the node version available on my environment). What can I do to make this module work with a proxy?

jerem-g avatar Nov 07 '19 09:11 jerem-g

@jerem-g looks like there is open issue over on https://github.com/grpc/grpc-node/issues/1005 that will support this

amammay avatar Nov 08 '19 21:11 amammay

I'm also running into this issue with [email protected], grpc/[email protected] I've already set up http_proxy, https_proxy & grpc_proxy point to a squid server Can you help me, thank you so much

cgcnrdpd avatar Apr 09 '20 05:04 cgcnrdpd

@cgcnrdpd make sure you're on grpc/[email protected], and give things a sho (bugs were recently fixed related to proxy support).

bcoe avatar Apr 13 '20 22:04 bcoe

I am having a similar issue, I upgraded dialogflow to 1.2 and @grpc/grpc-js to 0.7.9 and set all environment variables. (HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy, grpc_proxy)

It does not work. In my case i got the following error message image

ThWoywod avatar Apr 21 '20 08:04 ThWoywod

👋 we have proxy support being released soon for grpc.

@alexander-fenster once we've updated to v1.x.x of @grpc/grpc-js, we should update this thread.

bcoe avatar Apr 23 '20 22:04 bcoe

Updating this thread! @grpc/grpc-js v1.0.x will be pulled by google-gax v2.3.0 which has been released today.

alexander-fenster avatar Apr 24 '20 01:04 alexander-fenster