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 - Youns 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 - Youns 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.

Function Index

@@ -93,10 +90,12 @@ send_req/4, send_req/5, send_req/6.

- - + + @@ -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()

Same as spawn_worker_process/1 except the the calling process is linked to the worker process which is spawned.

-

spawn_worker_process/2

+

spawn_link_worker_process/2

-

spawn_worker_process(Host::string(), Port::integer()) -> {ok, pid()}

+

spawn_link_worker_process(Host::string(), Port::integer()) -> {ok, pid()}

+
+ +

spawn_worker_process/1

+
+

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/2

+
+

spawn_worker_process(Host::string(), Port::integer()) -> {ok, pid()}

+
+

start/0

start() -> any()

@@ -423,6 +441,6 @@ send_req/4, send_req/5, send_req/6.


all_trace_off/0Turn Off ALL tracing.
code_change/3
show_dest_status/0
show_dest_status/2Shows some internal information about load balancing to a specified Host:Port.
spawn_link_worker_process/2Same as spawn_worker_process/2 except the the calling process +
spawn_link_worker_process/1Same as spawn_worker_process/1 except the the calling process is linked to the worker process which is spawned.
spawn_worker_process/2Creates a HTTP client process to the specified Host:Port which +
spawn_link_worker_process/2
spawn_worker_process/1Creates a HTTP client process to the specified Host:Port which is not part of the load balancing pool.
spawn_worker_process/2
start/0Starts the ibrowse process without linking.
start_link/0Starts the ibrowse process linked to the calling process.
stop/0Stop the ibrowse process.
Overviewerlang logo
-

Generated by EDoc, Sep 5 2009, 23:59:48.

+

Generated by EDoc, May 17 2010, 23:21:42.

diff --git a/ebin/ibrowse.app b/ebin/ibrowse.app index ccab68c..dd0e8bc 100644 --- a/ebin/ibrowse.app +++ b/ebin/ibrowse.app @@ -1,6 +1,6 @@ {application, ibrowse, [{description, "HTTP client application"}, - {vsn, "1.5.3"}, + {vsn, "1.6.0"}, {modules, [ ibrowse, ibrowse_http_client, ibrowse_app, diff --git a/src/ibrowse.erl b/src/ibrowse.erl index eaf9aae..c1043ef 100644 --- a/src/ibrowse.erl +++ b/src/ibrowse.erl @@ -6,8 +6,8 @@ %%% Created : 11 Oct 2003 by Chandrashekhar Mullaparthi %%%------------------------------------------------------------------- %% @author Chandrashekhar Mullaparthi -%% @copyright 2005-2009 Chandrashekhar Mullaparthi -%% @version 1.5.4 +%% @copyright 2005-2010 Chandrashekhar Mullaparthi +%% @version 1.6.0 %% @doc The ibrowse application implements an HTTP 1.1 client. This %% module implements the API of the HTTP client. There is one named %% process called 'ibrowse' which assists in load balancing and maintaining configuration. There is one load balancing process per unique webserver. There is @@ -25,18 +25,18 @@ %%

%% %% 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). @@ -52,13 +52,8 @@ %% [{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.

-module(ibrowse). --vsn('$Id: ibrowse.erl,v 1.8 2009/07/01 22:43:19 chandrusf Exp $ '). - -behaviour(gen_server). %%-------------------------------------------------------------------- %% Include files @@ -70,48 +65,50 @@ %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, - terminate/2, code_change/3]). + terminate/2, code_change/3]). %% API interface -export([ - rescan_config/0, - rescan_config/1, - get_config_value/1, - get_config_value/2, - spawn_worker_process/2, - spawn_link_worker_process/2, - stop_worker_process/1, - send_req/3, - send_req/4, - send_req/5, - send_req/6, - send_req_direct/4, - send_req_direct/5, - send_req_direct/6, - send_req_direct/7, - stream_next/1, - set_max_sessions/3, - set_max_pipeline_size/3, - set_dest/3, - trace_on/0, - trace_off/0, - trace_on/2, - trace_off/2, - all_trace_off/0, - show_dest_status/0, - show_dest_status/2 - ]). + rescan_config/0, + rescan_config/1, + get_config_value/1, + get_config_value/2, + spawn_worker_process/1, + spawn_worker_process/2, + spawn_link_worker_process/1, + spawn_link_worker_process/2, + stop_worker_process/1, + send_req/3, + send_req/4, + send_req/5, + send_req/6, + send_req_direct/4, + send_req_direct/5, + send_req_direct/6, + send_req_direct/7, + stream_next/1, + set_max_sessions/3, + set_max_pipeline_size/3, + set_dest/3, + trace_on/0, + trace_off/0, + trace_on/2, + trace_off/2, + all_trace_off/0, + show_dest_status/0, + show_dest_status/2 + ]). -ifdef(debug). -compile(export_all). -endif. -import(ibrowse_lib, [ - parse_url/1, - get_value/3, - do_trace/2 - ]). - + parse_url/1, + get_value/3, + do_trace/2 + ]). + -record(state, {trace = false}). -include("ibrowse.hrl"). @@ -173,15 +170,15 @@ send_req(Url, Headers, Method, Body) -> %% For a description of SSL Options, look in the ssl manpage. If the %% HTTP Version to use is not specified, the default is 1.1. %%
-%%

The host_header option is useful in the case where ibrowse is +%%