i m using 2.0 but the code is same.. in 3.1 also i will have isSecure() and
isProxied() true.... because i want https and proxy server both... So that
means that DefaultProtocolSocketFactory will get initialized and not the
other one.. thAt is protocolInUse.getsocketFactory() which will be
MySocketFactory() in my case as i m registering the protocol by it....

So it wont be called and my impl of createSocket will be useless... :(  (or
i have to change the HTTPConnection class ..)

On 9/19/07, Roland Weber <[EMAIL PROTECTED]> wrote:
>
> nitya vyas wrote:
> > The problem I find now is that this createSocket method does not get
> called
> > from the HTTPConnection class... the reason being this line of
> code.....(i
> > dont wanna change the HTTPConnection if theres another way.. )
> >
> > final ProtocolSocketFactory socketFactory = (isSecure() && isProxied()?
> new
> > DefaultProtocolSocketFactory() : protocolInUse.getSocketFactory());
> >
>
> What version of HttpClient are you using?
> This is what I find in the current code (3.1 final):
>
>         if (isSecure() && isProxied()) {
>             Protocol defaultprotocol = Protocol.getProtocol("http");
>             socketFactory = defaultprotocol.getSocketFactory();
>         } else {
>             socketFactory = this.protocolInUse.getSocketFactory();
>         }
>
> So you can simply register your own protocol "http"
> that calls an instance of your socket factory.
>
> cheers,
>   Roland
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to