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 all-e <AL...@GMAIL.COM> on 2008/09/25 17:00:04 UTC

HttpCore 4.0 beta 2: JDK 1.3: connecting with a proxy server

I got all the code working with HttpCore only to find out that we were now
going to have to use a proxy server. And that becomes a little complicated
because calling proxy from the native socket connection at JDK 1.3 is a
little complicated. 

Does anyone know how to use a proxy server with HttpCore 4.0 beta 2.

Any help would be appreciated
-- 
View this message in context: http://www.nabble.com/HttpCore-4.0-beta-2%3A-JDK-1.3%3A-connecting-with-a-proxy-server-tp19671350p19671350.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


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


Re: HttpCore 4.0 beta 2: JDK 1.3: connecting with a proxy server

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2008-09-26 at 06:15 -0700, all-e wrote:
> Thanks, Oleg,
> 
> We are currently running WebSphere Commerce 5.6.. needless to say JDK
> upgrade is out of the question. We are upgrading the product but that will
> take some time. Meanwhile, due to time constraints I have already coded it
> with 3.1. However, I would still love to get some direction on using
> httpcore.. There is no authentication involved in the proxy.
> 
> 

I have to be very, very brief. 

(1) Not tunneled HTTP requests (plain HTTP) are very simple. Just use
absolute request URIs and that is it

direct

HTTP/1.1 GET /stuff
Host: www.target.com 

proxied

HTTP/1.1 GET http://www.target.com/stuff
Host: www.target.com 

(2) Tunneled HTTP requests (HTTPS) are more complex

* Do HTTP CONNECT first as described here

5.2 Requesting a Tunnel with CONNECT
http://www.faqs.org/rfcs/rfc2817.html

* Create a socket layered over an existing socket connected to the proxy
http://java.sun.com/j2se/1.4.2/docs/api/javax/net/ssl/SSLSocketFactory.html#createSocket(java.net.Socket,%20java.lang.String,%20int,%20boolean)

* Rebind the connection to the new socket

* Execute requests as normal

Hope this helps

Oleg  


> 
> 
> olegk wrote:
> > 
> > On Thu, 2008-09-25 at 08:00 -0700, all-e wrote:
> >> I got all the code working with HttpCore only to find out that we were
> >> now
> >> going to have to use a proxy server. And that becomes a little
> >> complicated
> >> because calling proxy from the native socket connection at JDK 1.3 is a
> >> little complicated. 
> >> 
> >> Does anyone know how to use a proxy server with HttpCore 4.0 beta 2.
> >> 
> >> Any help would be appreciated
> > 
> > One can program HttpCore to generate HTTP messages compatible with HTTP
> > proxies (at the end of the day, that is exactly what HttpClient 4.0
> > does) It is not very difficult as long as there is no authentication
> > involved. If you do have to support authenticating proxies, you may be
> > much better off upgrading to Java 1.5 or using HttpClient 3.1 with Java
> > 1.3
> > 
> > Hope this helps
> > 
> > Oleg  
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: httpclient-users-help@hc.apache.org
> > 
> > 
> > 
> 


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


Re: HttpCore 4.0 beta 2: JDK 1.3: connecting with a proxy server

Posted by all-e <AL...@GMAIL.COM>.
Thanks, Oleg,

We are currently running WebSphere Commerce 5.6.. needless to say JDK
upgrade is out of the question. We are upgrading the product but that will
take some time. Meanwhile, due to time constraints I have already coded it
with 3.1. However, I would still love to get some direction on using
httpcore.. There is no authentication involved in the proxy.




olegk wrote:
> 
> On Thu, 2008-09-25 at 08:00 -0700, all-e wrote:
>> I got all the code working with HttpCore only to find out that we were
>> now
>> going to have to use a proxy server. And that becomes a little
>> complicated
>> because calling proxy from the native socket connection at JDK 1.3 is a
>> little complicated. 
>> 
>> Does anyone know how to use a proxy server with HttpCore 4.0 beta 2.
>> 
>> Any help would be appreciated
> 
> One can program HttpCore to generate HTTP messages compatible with HTTP
> proxies (at the end of the day, that is exactly what HttpClient 4.0
> does) It is not very difficult as long as there is no authentication
> involved. If you do have to support authenticating proxies, you may be
> much better off upgrading to Java 1.5 or using HttpClient 3.1 with Java
> 1.3
> 
> Hope this helps
> 
> Oleg  
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/HttpCore-4.0-beta-2%3A-JDK-1.3%3A-connecting-with-a-proxy-server-tp19671350p19688291.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


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


Re: HttpCore 4.0 beta 2: JDK 1.3: connecting with a proxy server

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2008-09-25 at 08:00 -0700, all-e wrote:
> I got all the code working with HttpCore only to find out that we were now
> going to have to use a proxy server. And that becomes a little complicated
> because calling proxy from the native socket connection at JDK 1.3 is a
> little complicated. 
> 
> Does anyone know how to use a proxy server with HttpCore 4.0 beta 2.
> 
> Any help would be appreciated

One can program HttpCore to generate HTTP messages compatible with HTTP
proxies (at the end of the day, that is exactly what HttpClient 4.0
does) It is not very difficult as long as there is no authentication
involved. If you do have to support authenticating proxies, you may be
much better off upgrading to Java 1.5 or using HttpClient 3.1 with Java
1.3

Hope this helps

Oleg  



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