igrigorik / em-http-request

Asynchronous HTTP Client (EventMachine + Ruby)
1.22k stars 222 forks source link

Add support for NO_PROXY env variable #355

Closed bwilczek closed 7 months ago

bwilczek commented 2 years ago

Implement missing feature, marked with this comment in http_connection_options.rb:

 # TODO: Add support for $http_no_proxy or $no_proxy ?

Set env variable no_proxy or NO_PROXY to provide coma-separated list of hosts for which env-provided HTTP_PROXY should not be used.

Domain wildcards are supported. For example: .tld will match any host name ending with .tld.

Example use:

HTTP_PROXY=http://host:8181 \
HTTPS_PROXY=http://host:8181 \
NO_PROXY=service1,.anything.in.subdomain,service2.internal \
bundle exec ruby my-app-with-em-http-request.rb