Hi Oleg,

I'm well ware of what HTTP CONNECT is used for and how it works.  When I added
the explicit protocol selection in the snippet of code previously sent
out, I was
just checking to see if the scheme would e inherited from the host
configuration.
I had meant to cut that code out prior to sending out my email but it
looks like I
had forgotten do do that..

I'm just trying to get an HTTP CONNECT to work through an upstream proxy
to a site passed to my code in the form of a hostname and port authority
specification.  It seems like it's getting tripped up in httpclient
when the authority
specification is being parsed/interpreted as a URI.

Thanks in advance,

Mike

On Sat, Jul 5, 2008 at 5:02 AM, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:
> On Thu, 2008-07-03 at 15:12 -0700, Mike Cumings wrote:
>> Hello all,
>>
>> I've got a question as to the usage of the ConnectMethod.  From the API,
>> it appears that the only non-deprecated way to create a HTTP CONNECT
>> connection is to construct a ConnectMethod instance, passing in a
>> HostConfiguration object configured for the target/destination host and port.
>> I've modelled this in the test case below:
>>
>>     public void testConnect() throws IOException {
>>         this.server.setHttpService(new EchoService());
>>         // Set default host
>>         this.client.getHostConfiguration().setHost(
>>                 this.server.getLocalAddress(),
>>                 this.server.getLocalPort(),
>>                 Protocol.getProtocol("http"));
>>
>>         HostConfiguration hConf = new HostConfiguration();
>>         hConf.setHost(
>>                 this.server.getLocalAddress(),
>>                 this.server.getLocalPort());
>>         ConnectMethod conn = new ConnectMethod(hConf);
>>         try {
>>             this.client.executeMethod(conn);
>>             assertEquals(HttpStatus.SC_OK, conn.getStatusCode());
>>         } finally {
>>             conn.releaseConnection();
>>         }
>>     }
> ...
>>
>> So my question is whether this is a bug or operator error?  Thanks in 
>> advance,
>>
>
> Mike,
>
> What is it exactly you are trying to achieve? CONNECT method is
> supposed to be used  for one thing and one thing only: to establish a
> tunnel through an HTTP proxy server. Why are you trying to execute this
> method as an ordinary HTTP request?
>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Mike Cumings

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to