hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: How to set proxy information in httpClient object from browser
Date Wed, 19 Sep 2007 18:21:02 GMT
nitya vyas wrote:
> i m using 2.0 but the code is same..

No it's not. Upgrade! 2.0 has been unsupported for an eternity.

> in 3.1 also i will have isSecure() and
> isProxied() true.... because i want https and proxy server both...

Yes.

> So that
> means that DefaultProtocolSocketFactory will get initialized and not the
> other one..

No it doesn't. Look at the code fragment I quoted:

>>         if (isSecure() && isProxied()) {
>>             Protocol defaultprotocol = Protocol.getProtocol("http");
>>             socketFactory = defaultprotocol.getSocketFactory();
>>         } else {
>>             socketFactory = this.protocolInUse.getSocketFactory();
>>         }

The factory is obtained from a protocol, which is *registered*
under the name "http". You can register _your_own_ protocol with
that name, and then _your_ socket factory is used.

Let me know when you have upgraded to 3.1.
Until then, don't expect me to help you out.

cheers,
  Roland


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