Added proxy, at least to make it is possible to use http://fiddler2.com/ to inspect the traffic.

This commit is contained in:
Jocelyn Fiat
2012-02-07 15:44:45 +01:00
parent 2f43660628
commit 2b9ca86501
2 changed files with 17 additions and 0 deletions

View File

@@ -42,6 +42,8 @@ feature -- Access
upload_filename: detachable READABLE_STRING_8
proxy: detachable TUPLE [host: READABLE_STRING_8; port: INTEGER]
feature -- Status report
has_form_data: BOOLEAN
@@ -90,4 +92,13 @@ feature -- Element change
upload_filename := a_fn
end
set_proxy (a_host: detachable READABLE_STRING_8; a_port: INTEGER)
do
if a_host = Void then
proxy := Void
else
proxy := [a_host, a_port]
end
end
end

View File

@@ -74,6 +74,12 @@ feature -- Execution
--| RESPONSE HEADERS
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_header, 1)
--| PROXY ...
if ctx /= Void and then attached ctx.proxy as l_proxy then
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_proxyport, l_proxy.port)
curl_easy.setopt_string (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_proxy, l_proxy.host)
end
--| Timeout
if timeout > 0 then
curl_easy.setopt_integer (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_timeout, timeout)