GitSquared / node-geolite2-redist

Redistribution of MaxMind GeoLite2 GeoIP databases as an npm library
https://gitsquared.github.io/node-geolite2-redist/
Other
81 stars 18 forks source link

Using behind proxy #23

Closed rvalle closed 2 years ago

rvalle commented 2 years ago

My service is in a closed network access to Internet via proxy.

I wonder now to enable proxy support. typical environment variables are not working.

Seems like this library is using got as http agent

And the documentation mentions that it is possible to create a "global-agent"

Any idea how that would go?

GitSquared commented 2 years ago

Yes, we don't currently support proxy configs. I could add that in, could you tell me which environment variables you're trying to use so i can get an idea of the config you'd like?

(tech impl notes: got docs recommend using a proxy agent, see here)

rvalle commented 2 years ago

I was attempting to use the standard HTTP_PROXY, HTTPS_PROXY and NO_PROXY

After reviewing the documentation my server needed only:

import 'global-agent/bootstrap';

That one-liner fixes it all, for this and other HTTP client usages, although environment variables are customizable.

GitSquared commented 2 years ago

Interesting, thanks for the ref. Seems like you can indeed override the global agent for all HTTP requests from Node!