Example usage for io.netty.handler.codec.spdy SpdyVersion SPDY_3_1

List of usage examples for io.netty.handler.codec.spdy SpdyVersion SPDY_3_1

Introduction

In this page you can find the example usage for io.netty.handler.codec.spdy SpdyVersion SPDY_3_1.

Prototype

SpdyVersion SPDY_3_1

To view the source code for io.netty.handler.codec.spdy SpdyVersion SPDY_3_1.

Click Source Link

Usage

From source file:com.flysoloing.learning.network.netty.spdy.server.SpdyOrHttpHandler.java

License:Apache License

@Override
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception {
    if (ApplicationProtocolNames.SPDY_3_1.equals(protocol)) {
        configureSpdy(ctx, SpdyVersion.SPDY_3_1);
        return;/*ww w  .ja v a  2 s  .c  o  m*/
    }

    if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) {
        configureHttp1(ctx);
        return;
    }

    throw new IllegalStateException("unknown protocol: " + protocol);
}

From source file:org.pidome.server.system.network.http.HttpProtocolNegotiator.java

/**
 * Configures the HTTP pipeline.//from  w  w w .j a v  a 2  s  .c o  m
 * @param ctx Channel handler context.
 * @param protocol Protocol initiated. either http 1.1 or spdy (http 2)
 * @throws Exception 
 */
@Override
protected void configurePipeline(ChannelHandlerContext ctx, String protocol) throws Exception {
    LOG.debug("Got protocol: {}", protocol);
    if (ApplicationProtocolNames.SPDY_3_1.equals(protocol)) {
        configureSpdy(ctx, SpdyVersion.SPDY_3_1, port);
        return;
    }

    if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) {
        configureHttp1(ctx, ssl, port);
        return;
    }

    if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {
        configureHttp2(ctx, port);
        return;
    }

    LOG.warn("unknown protocol: " + protocol);
}