hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Re: adding headers to proxy CONNECT request
Date Sat, 26 Feb 2005 19:15:28 GMT
On Sat, 2005-02-26 at 20:52 +0200, Filip Filipov wrote:
> hallo! thanks for the quick response. 
> Yes i have customized mod_proxy for Apache. I need to send header saying which local
proxy of the proxy server to be used for the connections.
> I will try to modify the HttpClient to be able to do that. 
> The request now is this one:
> 
> CONNECT localhost:443 HTTP/1.1
> User-Agent: Jakarta Commons-HttpClient/3.0-alpha2
> Host: localhost
> Proxy-Connection: Keep-Alive
> 
> I need to add one more property when creating the SSL tunel.
> Any hits how to do that?
> 
> I'm diggin in HttpMethodDirector.executeConnect() but still no success. I saw the ProxyTunnelDemo.java
but Its not covninieto to use ProxyClient in my application.  

Filip,

You can add additional request headers at this point:

http://jakarta.apache.org/commons/httpclient/3.0/xref/org/apache/commons/httpclient/HttpMethodDirector.html#460

this.connectMethod.setRequestHeader("myheader", "whatever");

However, please note if you find yourself forking too many open-source
libraries to get the job done, this may be a strong indication that you
should reconsider the overall design of your application.

Hope this help

Oleg

> 
> Filip
> 
>  >-------- Оригинално писмо --------
>  >От:  Oleg Kalnichevski <olegk@apache.org>
>  >Относно: Re: adding headers to proxy CONNECT request
>  >До: HttpClient User Discussion <httpclient-user@jakarta.apache.org>
>  >Изпратено на: Събота, 2005, Февруари 26 20:27:34 EET
>  >----------------------------------
>  >
>  >On Sat, 2005-02-26 at 18:07 +0200, Filip Filipov wrote:
>  >> is it possible to add headers to the CONNECT request.
>  >
>  >Not really. We have never considered that as a practical requirement.
>  >Why would you want to do that? Are you developing a custom proxy
>  >software of any kind? 
>  >
>  >Oleg
>  >
>  >>  the reason i want to do that is that i want to send custom headers to the
proxy server when executing GET method to https://www.domain.com via proxy. 
>  >> Iam NOT asking about proxy authentication
>  >> 
>  >> -----------------------------------------------------------------
>  >> http://gbg.bg/search - Изпробвайте още сега най-добрата
българска търсачка!
>  >> 
>  >> ---------------------------------------------------------------------
>  >> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
>  >> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>  >> 
>  >
>  >
> 
> -----------------------------------------------------------------
> http://gbg.bg/search - Изпробвайте още сега най-добрата българска
търсачка!


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message