Conditional Socket connection acceptance

14 views
Skip to first unread message

Pranith Vanaparthi

unread,
Apr 4, 2018, 8:50:32 PM4/4/18
to Netty discussions
Hi 

I am trying to block socket connection establishment from a IP by keeping a threshold count for a single IP. I am currently using SimpleChannelInboundHandler for message consumption.

Can some one help me in finding a reference to achieve this. 

Thanks in advance !!

Norman Maurer

unread,
Apr 5, 2018, 2:03:36 AM4/5/18
to ne...@googlegroups.com
If you really need to “block” the socket connection establishment you will need to use something like iptables or any other firewall. With netty you could just close it once you accepted it in channelActive(…).

For iptables see:




--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/91380e1b-0ea5-40d5-bb37-89e040efbde5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pranith Vanaparthi

unread,
Apr 6, 2018, 2:35:41 AM4/6/18
to ne...@googlegroups.com
Thanks Norman !!

I am able to achieve with below approach.

Also is there a way to identify the source of Netty connection i.e what I mean is there a way to identify from where the socket connections are coming from. If there is a way in Netty I can set this at client while establishment of connection. I can get the same at server at channel active and verify whether it is a valid source.

Here I am trying to identify client level issue/from a external source in case of multiple channel connects 

Reply all
Reply to author
Forward
0 new messages