@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof Http2HeadersFrame){ final Http2HeadersFrame requestHeaders = (Http2HeadersFrame) msg; final SocketChannel channel = (SocketChannel) ctx.channel() .parent(); final Http2Headers headers = requestHeaders.headers(); accessLog = new AccessLog() .address(channel.remoteAddress().getHostString()) .port(channel.localAddress().getPort()) .method(headers.method()) .uri(headers.path()) .protocol(H2_PROTOCOL_NAME); } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { final HttpRequest request = (HttpRequest) msg; final SocketChannel channel = (SocketChannel) ctx.channel(); accessLog = new AccessLog() .address(channel.remoteAddress().getHostString()) .port(channel.localAddress().getPort()) .method(request.method().name()) .uri(request.uri()) .protocol(request.protocolVersion().text()); } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof HttpRequest) { final HttpRequest request = (HttpRequest) msg; final SocketChannel channel = (SocketChannel) ctx.channel(); accessLog = new AccessLog() .address(channel.remoteAddress().getHostString()) .port(channel.localAddress().getPort()) .method(request.method().name()) .uri(request.uri()) .protocol(request.protocolVersion().text()); } super.channelRead(ctx, msg); }
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof Http2HeadersFrame){ final Http2HeadersFrame requestHeaders = (Http2HeadersFrame) msg; final SocketChannel channel = (SocketChannel) ctx.channel() .parent(); final Http2Headers headers = requestHeaders.headers(); accessLog = new AccessLog() .address(channel.remoteAddress().getHostString()) .port(channel.localAddress().getPort()) .method(headers.method()) .uri(headers.path()) .protocol(H2_PROTOCOL_NAME); } super.channelRead(ctx, msg); }