apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
796 stars 265 forks source link

Proxy support for subgraph calls #3926

Open MrOstling opened 11 months ago

MrOstling commented 11 months ago

Describe the solution you'd like I would like to be able to host the router behind a proxy and still be able to use it. More specifically we would like http proxy environment variables respected by the client used to make subgraph calls.

Describe alternatives you've considered No using apollo's services.

Additional context We are hosting the router behind a corporate proxy (this is a requirement from the powers that be) and we are getting an error when the router tries to make calls to the subgraphs.

 fetch_error=hyper::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: nodename nor servname provided, or not known" }))

It appears to be an issue related to proxy settings. We have attempted to set HTTP_PROXY, HTTPS_PROXY, and NO_PROXY. but it doesn't appear that those are respected.

mikirobles commented 4 months ago

@MrOstling Did you find a solution for this? Currently running into the same issue

MrOstling commented 4 months ago

Sort of... we are essentially running a reverse proxy inside the network between the router and our subgraphs that the router can talk to without having to set any client side proxy settings. It isn't ideal but it works.

rajendersaini commented 1 month ago

Can anyone comment on this who knows the code? I am blocked by this issue.