Class AbstractRemoteAddressFilter<T extends SocketAddress>

All Implemented Interfaces:
ChannelHandler, ChannelInboundHandler
Direct Known Subclasses:
IpSubnetFilter, RuleBasedIpFilter, UniqueIpFilter

public abstract class AbstractRemoteAddressFilter<T extends SocketAddress> extends ChannelInboundHandlerAdapter
This class provides the functionality to either accept or reject new Channels based on their IP address.

You should inherit from this class if you would like to implement your own IP-based filter. Basically you have to implement accept(ChannelHandlerContext, SocketAddress) to decided whether you want to accept or reject a connection from the remote address.

Furthermore overriding channelRejected(ChannelHandlerContext, SocketAddress) gives you the flexibility to respond to rejected (denied) connections. If you do not want to send a response, just have it return null. Take a look at RuleBasedIpFilter for details.