diff options
author | Mark H Weaver <mhw@netris.org> | 2013-06-07 00:47:33 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2013-07-16 19:33:32 -0400 |
commit | 23cf330c86a56b12525af0fea8ce7da0e0981e45 (patch) | |
tree | ebd1b0b3c326afdb4889def44ffe51c45f63eb00 /doc | |
parent | 06903786211afd9a554b8f009a37111f729607ee (diff) | |
download | guile-23cf330c86a56b12525af0fea8ce7da0e0981e45.tar.gz |
Add support for HTTP proxies.
* module/web/http.scm (http-proxy-port?, set-http-proxy-port?!): New
exported procedures.
(write-request-line): If we're using an http proxy, write an
absolute-URI in the request line.
* module/web/client.scm: Import (web http).
(current-http-proxy): New exported parameter.
(open-socket-for-uri): If 'current-http-proxy' is not false,
connect to the proxy instead of the URI host, and use
'set-http-proxy-port?!' to make note of that fact.
* doc/ref/web.texi (Web Client): Document 'current-http-proxy'.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ref/web.texi | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/ref/web.texi b/doc/ref/web.texi index 0d41f9f7a..c59f9580d 100644 --- a/doc/ref/web.texi +++ b/doc/ref/web.texi @@ -1459,6 +1459,20 @@ fetcher, similar in structure to the web server (@pxref{Web Server}). Another option, good but not as performant, would be to use threads, possibly via par-map or futures. +@deffn {Scheme Parameter} current-http-proxy +Either @code{#f} or a non-empty string containing the URL of the HTTP +proxy server to be used by the procedures in the @code{(web client)} +module, including @code{open-socket-for-uri}. Its initial value is +based on the @env{http_proxy} environment variable. + +@example +(current-http-proxy) @result{} "http://localhost:8123/" +(parameterize ((current-http-proxy #f)) + (http-get "http://example.com/")) ; temporarily bypass proxy +(current-http-proxy) @result{} "http://localhost:8123/" +@end example +@end deffn + @node Web Server @subsection Web Server |