protected String remoteHttpHost ( ChannelHandlerContext ctx ) { if ( remoteHttpHost == null ) { SocketAddress addr = ctx . channel ( ) . remoteAddress ( ) ; if ( addr instanceof InetSocketAddress ) { InetSocketAddress inetAddr = ( InetSocketAddress ) addr ; remoteHttpHost = inetAddr . getAddress ( ) . getHostAddress ( ) + ":" + inetAddr . getPort ( ) ; } else { remoteHttpHost = addr . toString ( ) ; } } return remoteHttpHost ; }
Helper method to return the remote http host cached .