5.2 Proxies and Gatewaying

Proxy servers are commonly used to provide gateways through firewalls or as caches serving some more-or-less local network. Each protocol (HTTP, FTP, etc.) can have a different gateway server. Proxying is conventionally configured commonly amongst different programs through environment variables of the form protocol_proxy, where protocol is one of the supported network protocols (http, ftp etc.). The library recognizes such variables in either upper or lower case. Their values are of one of the forms:

The NO_PROXY environment variable specifies URLs that should be excluded from proxying (on servers that should be contacted directly). This should be a comma-separated list of hostnames, domain names, or a mixture of both. Asterisks can be used as wildcards, but other clients may not support that. Domain names may be indicated by a leading dot. For example:

NO_PROXY="*.aventail.com,home.com,.seanet.com"

says to contact all machines in the ‘aventail.com’ and ‘seanet.com’ domains directly, as well as the machine named ‘home.com’. If NO_PROXY isn’t defined, no_PROXY and no_proxy are also tried, in that order.

Proxies may also be specified directly in Lisp.

User Option: url-proxy-services

This variable is an alist of URL schemes and proxy servers that gateway them. The items are of the form (scheme . host:portnumber), says that the URL scheme is gatewayed through portnumber on the specified host. An exception is the pseudo scheme "no_proxy", which is paired with a regexp matching host names not to be proxied. This variable is initialized from the environment as above.

(setq url-proxy-services
      '(("http"     . "proxy.aventail.com:80")
        ("no_proxy" . "^.*\\(aventail\\|seanet\\)\\.com")))