Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Define and use default http proxy #31

Merged
merged 2 commits into from

2 participants

@zellerin

Please consider this patch.

It defines default-http-proxy variable to be used as default value for
proxy parameter of the http-request call, and exports it.

This is useful in particular when a library (such as, e.g., zs3) is wrapping the http-request calls without passing the proxy parameter along (which would be awkward anyway). Also, the proxy tends to be same for many requests.

I did not change index.xml/html, as I am not sure whether it is generated manually or automatically.

zellerin added some commits
@zellerin zellerin Allow using default http proxy
Define *default-http-proxy* variable to be used as default value for
proxy parameter of the http-request call, and export it.
3c5ead2
@zellerin zellerin Default proxy documentation update. a8a3ba2
@zellerin

Updated index.xml.

@zellerin zellerin closed this
@zellerin zellerin reopened this
@hanshuebner hanshuebner merged commit c9b978f into edicl:master
@hanshuebner
Owner

Merged, thanks!

@zellerin

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 3, 2013
  1. @zellerin

    Allow using default http proxy

    zellerin authored
    Define *default-http-proxy* variable to be used as default value for
    proxy parameter of the http-request call, and export it.
Commits on Jul 4, 2013
  1. @zellerin
This page is out of date. Refresh to see the latest.
Showing with 27 additions and 3 deletions.
  1. +16 −1 doc/index.xml
  2. +1 −0  packages.lisp
  3. +3 −2 request.lisp
  4. +7 −0 specials.lisp
View
17 doc/index.xml
@@ -957,7 +957,8 @@ T</span>
the request should be sent. Or it can be a list of two
values - a string denoting the proxy server and an integer
denoting the port to use (which will default to 80
- otherwise).
+ otherwise). Defaults to
+ <clix:arg>*default-http-proxy*</clix:arg>.
<clix:arg>proxy-basic-authorization</clix:arg> is used
like <clix:arg>basic-authorization</clix:arg>, but for the
proxy, and only if <clix:arg>proxy</clix:arg> is true.
@@ -1172,6 +1173,20 @@ T</span>
</clix:description>
</clix:special-variable>
+ <clix:special-variable name="*default-http-proxy*">
+ <clix:description>
+ <p>
+ HTTP proxy to be used as default for the proxy keyword
+ argument of <clix:ref>HTTP-REQUEST</clix:ref>. If not
+ <code>NIL</code>, it should be a string denoting a proxy
+ server through which the request should be sent. Or it
+ can be a list of two values - a string denoting the proxy
+ server and an integer denoting the port to use (which
+ will default to 80 otherwise).
+ </p>
+ </clix:description>
+ </clix:special-variable>
+
<clix:special-variable name="*drakma-default-external-format*">
<clix:description>
<p>
View
1  packages.lisp
@@ -37,6 +37,7 @@
(:export #:*allow-dotless-cookie-domains-p*
#:*body-format-function*
#:*remove-duplicate-cookies-p*
+ #:*default-http-proxy*
#:*drakma-default-external-format*
#:*header-stream*
#:*ignore-unparseable-cookie-dates-p*
View
5 request.lisp
@@ -205,7 +205,7 @@ headers of the chunked stream \(if any) as a second value."
(user-agent :drakma)
(accept "*/*")
range
- proxy
+ (proxy *default-http-proxy*)
proxy-basic-authorization
real-host
additional-headers
@@ -375,7 +375,8 @@ If PROXY is not NIL, it should be a string denoting a proxy
server through which the request should be sent. Or it can be a
list of two values - a string denoting the proxy server and an
integer denoting the port to use \(which will default to 80
-otherwise). PROXY-BASIC-AUTHORIZATION is used like
+otherwise). Defaults to *default-http-proxy*.
+PROXY-BASIC-AUTHORIZATION is used like
BASIC-AUTHORIZATION, but for the proxy, and only if PROXY is
true.
View
7 specials.lisp
@@ -248,6 +248,13 @@ proceeds as described in the HTTP-REQUEST documentation entry.")
"An alist which maps time zone abbreviations to Common Lisp
timezones.")
+(defvar *default-http-proxy* nil
+ "HTTP proxy to be used as default. If not NIL, it should be a string
+denoting a proxy server through which the request should be sent. Or
+it can be a list of two values - a string denoting the proxy server
+and an integer denoting the port to use \(which will default to 80
+otherwise).")
+
;; stuff for Nikodemus Siivola's HYPERDOC
;; see <http://common-lisp.net/project/hyperdoc/>
;; and <http://www.cliki.net/hyperdoc>
Something went wrong with that request. Please try again.