@Override
    public void channelActive(ChannelHandlerContext ctx) throws Exception {
        ctx.channel().attr(ATTR_REMOTE_ADDR).set(ctx.channel().remoteAddress());
        InetSocketAddress sourceAddress = sourceAddress(ctx.channel());
        ctx.channel().attr(ATTR_SOURCE_INET_ADDR).setIfAbsent(sourceAddress);
        ctx.channel().attr(ATTR_SOURCE_ADDRESS).setIfAbsent(getHostAddress(sourceAddress));
        ctx.channel().attr(ATTR_LOCAL_ADDR).set(ctx.channel().localAddress());
        InetSocketAddress localAddress = localAddress(ctx.channel());
        ctx.channel().attr(ATTR_LOCAL_INET_ADDR).setIfAbsent(localAddress);
        ctx.channel().attr(ATTR_LOCAL_ADDRESS).setIfAbsent(getHostAddress(localAddress));
        // ATTR_LOCAL_ADDRESS and ATTR_LOCAL_PORT get overwritten with what is received in
        // Proxy Protocol (via the LB), so set local server's address, port explicitly
        ctx.channel()
                .attr(ATTR_SERVER_LOCAL_ADDRESS)
                .setIfAbsent(localAddress.getAddress().getHostAddress());
        ctx.channel().attr(ATTR_SERVER_LOCAL_PORT).setIfAbsent(localAddress.getPort());

        super.channelActive(ctx);
    }
The port number of the local socket, or {@code -1} if not appropriate.  This is not overwritten by the Proxy
Protocol message if present.
zuul-core/src/main/java/com/netflix/netty/common/SourceAddressChannelHandler.java