in reply to Block IP addresses with IO::Socket
I think such blocking must be done on a lower TCP level, as Perl shields us from the ugly state machine that is a TCP connection - my way would be to set up a (simplicistic) firewall and manipulate the rules to block packets from within the program:
You should still do the second check in your program, and you should maybe clean/expire the firewall blocks from time to time.
In the end I think that a firewall will be necessary anyway, as you have a machine connected to the internet.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
|
|---|
| Replies are listed 'Best First'. |
|---|