Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added *no-proxy-domains*.

Proxy whitelist will allow you to specify a list of hosts which will
not be subjected to being routed via the specified proxy.
  • Loading branch information...
commit 28dab0a4e8f538c7befd162a58f306531d634744 1 parent 1728e3f
@AeroNotix AeroNotix authored
Showing with 15 additions and 1 deletion.
  1. +1 −0  packages.lisp
  2. +11 −1 request.lisp
  3. +3 −0  specials.lisp
View
1  packages.lisp
@@ -38,6 +38,7 @@
#:*body-format-function*
#:*remove-duplicate-cookies-p*
#:*default-http-proxy*
+ #:*no-proxy-domains*
#:*drakma-default-external-format*
#:*header-stream*
#:*ignore-unparseable-cookie-dates-p*
View
12 request.lisp
@@ -204,6 +204,7 @@ headers of the chunked stream \(if any) as a second value."
(accept "*/*")
range
(proxy *default-http-proxy*)
+ (no-proxy-domains *no-proxy-domains*)
proxy-basic-authorization
real-host
additional-headers
@@ -376,7 +377,13 @@ integer denoting the port to use \(which will default to 80
otherwise). Defaults to *default-http-proxy*.
PROXY-BASIC-AUTHORIZATION is used like
BASIC-AUTHORIZATION, but for the proxy, and only if PROXY is
-true.
+true. If the host portion of the uri is present in the
+*no-proxy-domains* or the NO-PROXY-DOMAINS list then the proxy
+setting will be ignored for this request.
+
+If NO-PROXY-DOMAINS is set then it will supersede the
+*no-proxy-domains* variable. Inserting domains into this list will
+allow them to ignore the proxy setting.
If REAL-HOST is not NIL, request is sent to the denoted host instead
of the URI host. When specified, REAL-HOST supersedes PROXY.
@@ -481,6 +488,9 @@ PARAMETERS will not be used."
(when proxy
(when (atom proxy)
(setq proxy (list proxy 80))))
+ ;; Ignore the proxy for whitelisted hosts.
+ (when (member (uri-host uri) no-proxy-domains :test #'string=)
+ (setq proxy '()))
;; make sure we don't get :CRLF on Windows
(let ((*default-eol-style* :lf)
(file-parameters-p (find-if-not (lambda (thing)
View
3  specials.lisp
@@ -260,6 +260,9 @@ otherwise).")
;; and <http://www.cliki.net/hyperdoc>
;; also used by LW-ADD-ONS
+(defvar *no-proxy-domains* nil
+ "A list of domains for which a proxy should not be used.")
+
(defvar *hyperdoc-base-uri* "http://weitz.de/drakma/")
(let ((exported-symbols-alist
Please sign in to comment.
Something went wrong with that request. Please try again.