diff --git a/library/client/http_client/src/http_client_request_context.e b/library/client/http_client/src/http_client_request_context.e index 3dab9dc6..55774d54 100644 --- a/library/client/http_client/src/http_client_request_context.e +++ b/library/client/http_client/src/http_client_request_context.e @@ -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 diff --git a/library/client/http_client/src/spec/libcurl/libcurl_http_client_request.e b/library/client/http_client/src/spec/libcurl/libcurl_http_client_request.e index fbf433fb..fb3c7c90 100644 --- a/library/client/http_client/src/spec/libcurl/libcurl_http_client_request.e +++ b/library/client/http_client/src/spec/libcurl/libcurl_http_client_request.e @@ -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)