Package io.netty.handler.codec.http2

Examples of io.netty.handler.codec.http2.HttpUtil


    private static Http2FrameReader frameReader() {
        return new Http2InboundFrameLogger(new DefaultHttp2FrameReader(), logger);
    }

    private static Http2FrameWriter frameWriter() {
        return new Http2OutboundFrameLogger(new DefaultHttp2FrameWriter(), logger);
    }
View Full Code Here


    static final ByteBuf RESPONSE_BYTES = unreleasableBuffer(copiedBuffer("Hello World", CharsetUtil.UTF_8));

    public HelloWorldHttp2Handler() {
        this(new DefaultHttp2Connection(true), new Http2InboundFrameLogger(
                new DefaultHttp2FrameReader(), logger), new Http2OutboundFrameLogger(
                new DefaultHttp2FrameWriter(), logger), new SimpleHttp2FrameListener());
    }
View Full Code Here

    @Override
    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
        if (evt instanceof HttpServerUpgradeHandler.UpgradeEvent) {
            // Write an HTTP/2 response to the upgrade request
            Http2Headers headers =
                    new DefaultHttp2Headers().status(new AsciiString("200"))
                    .set(new AsciiString(UPGRADE_RESPONSE_HEADER), new AsciiString("true"));
            encoder().writeHeaders(ctx, 1, headers, 0, true, ctx.newPromise());
        }
        super.userEventTriggered(ctx, evt);
    }
View Full Code Here

        /**
         * Sends a "Hello World" DATA frame to the client.
         */
        private void sendResponse(ChannelHandlerContext ctx, int streamId, ByteBuf payload) {
            // Send a frame for the response status
            Http2Headers headers = new DefaultHttp2Headers().status(new AsciiString("200"));
            encoder.writeHeaders(ctx, streamId, headers, 0, false, ctx.newPromise());
            encoder.writeData(ctx, streamId, payload, 0, true, ctx.newPromise());
            ctx.flush();
        }
View Full Code Here

    }

    private HelloWorldHttp2Handler(Http2Connection connection, Http2FrameWriter frameWriter) {
        super(connection, new Http2InboundFrameLogger(new DefaultHttp2FrameReader(), logger),
                frameWriter,
                new DefaultHttp2InboundFlowController(connection, frameWriter),
                new DefaultHttp2OutboundFlowController(connection, frameWriter));
    }
View Full Code Here

    @Override
    public void initChannel(SocketChannel ch) throws Exception {
        Http2Connection connection = new DefaultHttp2Connection(false);
        Http2FrameWriter frameWriter = frameWriter();
        connectionHandler = new DelegatingHttp2HttpConnectionHandler(connection,
                        frameReader(), frameWriter, new DefaultHttp2InboundFlowController(connection, frameWriter),
                        new DefaultHttp2OutboundFlowController(connection, frameWriter),
                        InboundHttp2ToHttpAdapter.newInstance(connection, maxContentLength));
        responseHandler = new HttpResponseHandler();
        settingsHandler = new Http2SettingsHandler(ch.newPromise());
        if (sslCtx != null) {
View Full Code Here

        final Http2Connection connection = new DefaultHttp2Connection(false);
        final Http2FrameWriter frameWriter = frameWriter();
        connectionHandler = new Http2ToHttpConnectionHandler(connection,
                frameReader(),
                frameWriter,
                new DefaultHttp2InboundFlowController(connection, frameWriter),
                new DefaultHttp2OutboundFlowController(connection, frameWriter),
                new DelegatingDecompressorFrameListener(connection,
                        InboundHttp2ToHttpAdapter.newInstance(connection, maxContentLength)));
        responseHandler = new HttpResponseHandler();
        settingsHandler = new Http2SettingsHandler(ch.newPromise());
View Full Code Here

    private HelloWorldHttp2Handler(Http2Connection connection, Http2FrameWriter frameWriter) {
        super(connection, new Http2InboundFrameLogger(new DefaultHttp2FrameReader(), logger),
                frameWriter,
                new DefaultHttp2InboundFlowController(connection, frameWriter),
                new DefaultHttp2OutboundFlowController(connection, frameWriter));
    }
View Full Code Here

    public void initChannel(SocketChannel ch) throws Exception {
        Http2Connection connection = new DefaultHttp2Connection(false);
        Http2FrameWriter frameWriter = frameWriter();
        connectionHandler = new DelegatingHttp2HttpConnectionHandler(connection,
                        frameReader(), frameWriter, new DefaultHttp2InboundFlowController(connection, frameWriter),
                        new DefaultHttp2OutboundFlowController(connection, frameWriter),
                        InboundHttp2ToHttpAdapter.newInstance(connection, maxContentLength));
        responseHandler = new HttpResponseHandler();
        settingsHandler = new Http2SettingsHandler(ch.newPromise());
        if (sslCtx != null) {
            configureSsl(ch);
View Full Code Here

        final Http2FrameWriter frameWriter = frameWriter();
        connectionHandler = new Http2ToHttpConnectionHandler(connection,
                frameReader(),
                frameWriter,
                new DefaultHttp2InboundFlowController(connection, frameWriter),
                new DefaultHttp2OutboundFlowController(connection, frameWriter),
                new DelegatingDecompressorFrameListener(connection,
                        InboundHttp2ToHttpAdapter.newInstance(connection, maxContentLength)));
        responseHandler = new HttpResponseHandler();
        settingsHandler = new Http2SettingsHandler(ch.newPromise());
        if (sslCtx != null) {
View Full Code Here

TOP

Related Classes of io.netty.handler.codec.http2.HttpUtil

Copyright © 2018 www.massapicom. 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.