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]