From 8a4653d4d4021241a4222bcd4eec16fd1b598a2c Mon Sep 17 00:00:00 2001
From: Chandrashekhar Mullaparthi
Date: Mon, 17 May 2010 23:22:51 +0100
Subject: [PATCH] Added support for tunnelling through a proxy. Other minor
changes as indicated in the README
---
README | 19 +-
doc/ibrowse.html | 76 +-
ebin/ibrowse.app | 2 +-
src/ibrowse.erl | 480 +++++------
src/ibrowse_app.erl | 1 -
src/ibrowse_http_client.erl | 1577 ++++++++++++++++++++---------------
src/ibrowse_lb.erl | 2 -
src/ibrowse_lib.erl | 213 ++---
src/ibrowse_sup.erl | 2 -
src/ibrowse_test.erl | 1 -
vsn.mk | 2 +-
11 files changed, 1325 insertions(+), 1050 deletions(-)
diff --git a/README b/README
index e534803..1a1dc42 100644
--- a/README
+++ b/README
@@ -18,12 +18,25 @@ ibrowse is available under two different licenses. LGPL and the BSD license.
Comments to : Chandrashekhar.Mullaparthi@gmail.com
-Version : 1.5.6
+Version : 1.5.7
Latest version : git://github.com/cmullaparthi/ibrowse.git
CONTRIBUTIONS & CHANGE HISTORY
==============================
+12-05-2010 - * Added support for the CONNECT method to tunnel HTTPS through
+ a proxy. When a https URL is requested through a proxy,
+ ibrowse will automatically use the CONNECT method to first
+ setup a tunnel through the proxy. Once this succeeds, the
+ actual request is dispatched. Successfully tested with the
+ new SSL implementation in R13B-03
+ * Added SSL support for direct connections.
+ See ibrowse:spawn_worker_process/1 and
+ ibrowse:spawn_link_worker_process/1
+ * Added option to return raw status line and raw unparsed headers
+
+23-04-2010 - * Fixes to URL parsing by Karol Skocik
+
08-11-2009 - * Added option headers_as_is
04-10-2009 - * Patch from Kostis Sagonas to cleanup some code and suppress
@@ -132,7 +145,7 @@ CONTRIBUTIONS & CHANGE HISTORY
12-01-2007 - Derek Upham sent in a bug fix. The reset_state function was not
behaving correctly when the transfer encoding was not chunked.
-13-11-2006 - Youns Hafri reported a bug where ibrowse was not returning the
+13-11-2006 - Youns Hafri reported a bug where ibrowse was not returning the
temporary filename when the server was closing the connection
after sending the data (as in HTTP/1.0).
Released ibrowse under the BSD license
@@ -151,7 +164,7 @@ CONTRIBUTIONS & CHANGE HISTORY
22-Nov-2005 - Added ability to generate requests using the Chunked
Transfer-Encoding.
-08-May-2005 - Youns Hafri made a CRUX LINUX port of ibrowse.
+08-May-2005 - Youns Hafri made a CRUX LINUX port of ibrowse.
http://yhafri.club.fr/crux/index.html
Here are some usage examples. Enjoy!
diff --git a/doc/ibrowse.html b/doc/ibrowse.html
index 79e4753..590ff9a 100644
--- a/doc/ibrowse.html
+++ b/doc/ibrowse.html
@@ -10,9 +10,9 @@
Module ibrowse
The ibrowse application implements an HTTP 1.1 client.
-Copyright 2005-2009 Chandrashekhar Mullaparthi
+Copyright 2005-2010 Chandrashekhar Mullaparthi
-Version: 1.5.2
+Version: 1.6.0
Behaviours: gen_server.
Authors: Chandrashekhar Mullaparthi (chandrashekhar dot mullaparthi at gmail dot com).
@@ -28,23 +28,23 @@ send_req/4, send_req/5, send_req/6.
Here are a few sample invocations.
-
+
ibrowse:send_req("http://intranet/messenger/", [], get).
ibrowse:send_req("http://www.google.com/", [], get, [],
- [{proxy_user, "XXXXX"},
- {proxy_password, "XXXXX"},
- {proxy_host, "proxy"},
- {proxy_port, 8080}], 1000).
+ [{proxy_user, "XXXXX"},
+ {proxy_password, "XXXXX"},
+ {proxy_host, "proxy"},
+ {proxy_port, 8080}], 1000).
ibrowse:send_req("http://www.erlang.org/download/otp_src_R10B-3.tar.gz", [], get, [],
- [{proxy_user, "XXXXX"},
- {proxy_password, "XXXXX"},
- {proxy_host, "proxy"},
- {proxy_port, 8080},
- {save_response_to_file, true}], 1000).
+ [{proxy_user, "XXXXX"},
+ {proxy_password, "XXXXX"},
+ {proxy_host, "proxy"},
+ {proxy_port, 8080},
+ {save_response_to_file, true}], 1000).
ibrowse:send_req("http://www.erlang.org", [], head).
@@ -58,11 +58,8 @@ send_req/4, send_req/5, send_req/6.
ibrowse:send_req("http://www.google.com", [], get, [],
[{stream_to, self()}]).
-
+
- A driver exists which implements URL encoding in C, but the
- speed achieved using only erlang has been good enough, so the
- driver isn't actually used.
all_trace_off/0 | Turn Off ALL tracing. |
code_change/3 | |
@@ -93,10 +90,12 @@ send_req/4, send_req/5, send_req/6.
show_dest_status/0 | |
show_dest_status/2 | Shows some internal information about load balancing to a
specified Host:Port. |
-spawn_link_worker_process/2 | Same as spawn_worker_process/2 except the the calling process
+ |
spawn_link_worker_process/1 | Same as spawn_worker_process/1 except the the calling process
is linked to the worker process which is spawned. |
-spawn_worker_process/2 | Creates a HTTP client process to the specified Host:Port which
+ |
spawn_link_worker_process/2 | |
+spawn_worker_process/1 | Creates a HTTP client process to the specified Host:Port which
is not part of the load balancing pool. |
+spawn_worker_process/2 | |
start/0 | Starts the ibrowse process without linking. |
start_link/0 | Starts the ibrowse process linked to the calling process. |
stop/0 | Stop the ibrowse process. |
@@ -203,7 +202,7 @@ send_req/4, send_req/5, send_req/6.
send_req(Url::string(), Headers::headerList(), Method::method(), Body::body(), Options::optionList()) -> response()
@@ -340,15 +348,20 @@ send_req/4, send_req/5, send_req/6.
spawn_worker_process/2 or spawn_link_worker_process/2 is not
included.
-
+
-
spawn_link_worker_process(Host, Port) -> any()
-
Same as spawn_worker_process/2 except the the calling process
+
spawn_link_worker_process(Url::string()) -> {ok, pid()}
+
Same as spawn_worker_process/1 except the the calling process
is linked to the worker process which is spawned.
-
+
-
spawn_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
+
spawn_link_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
+
+
+
+
+
spawn_worker_process(Url::string()) -> {ok, pid()}
Creates a HTTP client process to the specified Host:Port which
is not part of the load balancing pool. This is useful in cases
where some requests to a webserver might take a long time whereas
@@ -362,6 +375,11 @@ send_req/4, send_req/5, send_req/6.
pipeline size on such connections.
+
+
+
spawn_worker_process(Host::string(), Port::integer()) -> {ok, pid()}
+
+
start() -> any()
@@ -423,6 +441,6 @@ send_req/4, send_req/5, send_req/6.
-
Generated by EDoc, Sep 5 2009, 23:59:48.
+
Generated by EDoc, May 17 2010, 23:21:42.