You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by "Kadlabalu, Hareesh" <ha...@fatwire.com> on 2005/08/04 15:57:52 UTC

Simple Protocol.registerProtocol() question

Hi, 

May be this question is answered or there is documentation and I am just not
seeing it; if so my apologies.

 

I want to build external configuration for registering ProtocolSocketFactory
per protocol (one for http, one for https etc), however port numbers can be
anything.

 

I can specify Protocol.registerProtocol( "https", new Protocol( "https",
MyProtocolSocketFactory.getInstance(), 443 )  );

 

The Javadoc says that the port specified is the 'default' port, so am I
correct in assuming that MyProtocolSocketFactory would be used for 'https'
and whatever port or only port 443? In other words, is the registration of
ProtocolSocketFactory specific to a protocol type (http/https) or 'type and
port number' combination? 

 

Thanks

-Hareesh

 

 

 

 

 

 

 

 

 

 

 

 


Re: Simple Protocol.registerProtocol() question

Posted by Oleg Kalnichevski <ol...@apache.org>.
Hareesh,

The default protocol port will be used if no port has been set explicitly 
in the request URI or the HostConfiguration instance associated with the 
HTTP method being executed

myhttps://myhost/stuff // no port given. 
// Use the default one associated with the 'myhttps' protocol instance

myhttps://myhost:7777/more%20stuff

One can always override the default port by giving a different one in
the request URI or in the HostConfiguration instance

Hope this helps,

Oleg


On Thu, Aug 04, 2005 at 09:57:52AM -0400, Kadlabalu, Hareesh wrote:
> Hi, 
> 
> May be this question is answered or there is documentation and I am just not
> seeing it; if so my apologies.
> 
>  
> 
> I want to build external configuration for registering ProtocolSocketFactory
> per protocol (one for http, one for https etc), however port numbers can be
> anything.
> 
>  
> 
> I can specify Protocol.registerProtocol( "https", new Protocol( "https",
> MyProtocolSocketFactory.getInstance(), 443 )  );
> 
>  
> 
> The Javadoc says that the port specified is the 'default' port, so am I
> correct in assuming that MyProtocolSocketFactory would be used for 'https'
> and whatever port or only port 443? In other words, is the registration of
> ProtocolSocketFactory specific to a protocol type (http/https) or 'type and
> port number' combination? 
> 
>  
> 
> Thanks
> 
> -Hareesh
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 

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