I didn't realize there is a method like block().  So if I have a pre-defined
list of blacklist,

- I call setBlacklist() at the time server is launched
- I call block() to immediately block any newly detected bad IP when server
is running
- I save all the new bad IPs together with already known bad IPs to keep my
blacklist updated ...

Thank you so much Ashish!

Zhijun

-----Original Message-----
From: Ashish [mailto:[email protected]] 
Sent: Monday, June 01, 2009 1:55 AM
To: [email protected]
Subject: Re: A question about using BlacklistFilter

>
> I've been using class BlacklistFilter for a while in this way:
>
>
>
> -          Start my mina server
>
> -          Read from DB those saved bad IPs
>
> -          Create an instance of BlacklistFilter and add to it the bad IPs
>
> -          Call DefaultIoFilterChainBuilder.addLast() to add the above
> filter
>
> -          Server continue running .
>
> -          When detecting incoming bad requests from bad IPs, server saves
> them to DB for use in next time restarting server

> I am not sure is the above the recommended/correct way to use
> BlacklistFilter.  I hope whenever bad IPs is detected, the filter can be
> updated and take effect immediately, instead of waiting for next time
> restarting server.  Is it possible?  If yes how?

You can use them in the same cycle, by adding the same to the
Blacklist filter and then saving to DB.
This off course shall depend upon your business needs.

see the block() API's in BlacklistFilter.java


-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Reply via email to