Examples of TunnelRequestEvent


Examples of org.asynchttpclient.providers.grizzly.filters.events.TunnelRequestEvent

            ((ExpectHandler) continueEvent.getContext().getBodyHandler()).finish(ctx);
        } else if (type == TunnelRequestEvent.class) {
            // Disable SSL for the time being...
            ctx.notifyDownstream(new SSLSwitchingEvent(false, ctx.getConnection()));
            ctx.suspend();
            TunnelRequestEvent tunnelRequestEvent = (TunnelRequestEvent) event;
            final ProxyServer proxyServer = tunnelRequestEvent.getProxyServer();
            final Uri requestUri = tunnelRequestEvent.getUri();

            RequestBuilder builder = new RequestBuilder();
            builder.setMethod(Method.CONNECT.getMethodString());
            builder.setUrl("http://" + getAuthority(requestUri));
            Request request = builder.build();
View Full Code Here

Examples of org.asynchttpclient.providers.grizzly.filters.events.TunnelRequestEvent

        // This event will be handled by the AsyncHttpClientFilter.
        // It will send the CONNECT request and process the response.
        // When tunnel is complete, the AsyncHttpClientFilter will
        // send this event back to this filter in order to notify
        // it that the request processing is complete.
        final TunnelRequestEvent tunnelRequestEvent = new TunnelRequestEvent(ctx, proxyServer, uri);
        ctx.notifyUpstream(tunnelRequestEvent);

        // This typically isn't advised, however, we need to be able to
        // read the response from the proxy and OP_READ isn't typically
        // enabled on the connection until all of the handleConnect()
View Full Code Here

Examples of org.asynchttpclient.providers.grizzly.filters.events.TunnelRequestEvent

    }

    @Override
    public NextAction handleEvent(FilterChainContext ctx, FilterChainEvent event) throws IOException {
        if (event.type() == TunnelRequestEvent.class) {
            TunnelRequestEvent tunnelRequestEvent = (TunnelRequestEvent) event;

            // Clear ignore status.  Any further use of the connection will
            // be bound by normal AHC connection processing.
            Utils.connectionIgnored(ctx.getConnection(), false);

            // Obtain the context that was previously suspended and resume.
            // We pass in Invoke Action so the filter chain will call
            // handleConnect on the next filter.
            FilterChainContext suspendedContext = tunnelRequestEvent.getSuspendedContext();
            suspendedContext.resume(ctx.getInvokeAction());

            // Stop further event processing.
            return ctx.getStopAction();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.