users@grizzly.java.net

Re: Make an http proxy with grizzly

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Fri, 17 Aug 2012 11:58:37 +0200

Hi,

can you pls. share the sources (or at least the part responsible for
CONNECT) so we can reproduce that?

Thanks.

WBR,
Alexey.

On 08/17/2012 11:49 AM, yann Blazart wrote:
> Hi ! I'm trying to implements my own proxy with grizzly, to pass my
> f... NTML entreprise proxy.
> I'm using httpclient 4.2 to get out.
>
> Well, everything is ok for Normal Http Method (get, put, delete ...).
>
> But I've some problem with connect method.
>
> In fact, I've writed my own HttpHandler, with the public void
> service(Request request, Response response) method.
>
> In this, in case of connect method, I made the connection thought the
> ProxyClient of HttpClient and make a tunnel by getting the socket.
> I write in the response.getOutputStream the "HTTP/1.1 200 Connection
> established".
>
> This is ok because in my unit test, the client receive it and after it
> try to make the SSL handshake.
>
> After this I made two Threads that make copy form
> request.getInputStream to socket output stream and from
> socket.getInputStream to request.getOutputStream.
>
> The problem is that the client write to grizzly his SSL things, but
> the request.getInputStream().read(...) return -1...
>
> Any idea ?