Re: [LP 7.1.3]how to limit an ip adress to x connections persecond for a specific page
Your example is exactly what I mean but I'm thinking more towards a global set with an array of IP's wich is cleared every two seconds or so
This eliminates the need for lots off database calls.
On donderdag, 2 juni 2005 16:27, Karim Dahdah <[hidden email]> wrote:
I haven't done this before, but I want to make something like that for a
The method I have in mind is the following:
I have a couple of IP addresses that are listed as 'trusted'. These IP
addresses can make as much connections to a page as they wish.
IP addresses that are not listed on that list can only make one
connection each 3 seconds (as an example).
I think of building 2 tables: one with the trusted IP addresses and one
with the connections (consist of IP address and timestamp).
Each time a connection is made, the webapp checks if the IP address is
listed in the trusted list. If it is, the client can view the page.
If it doesn't, then it checks if the timestamp in the second table (the
one with the connections) is more than 3 seconds old. Then the client
gets the page, otherwise a message or a blank page is displayed.
I haven't checked if this setup is a good one. But maybe we get some
thoughts from other people on this list! :)
-ASP- and Lasso Developer
Alan Linnenbank wrote:
> Has anybody tried something like this? We wan't a specific page to be restricted to x number off requests per ip adres per second. Probably need to use thread locks but I don't wan't it to work for all visitors as a whole like the extending examples state.
[If: (global: 'hitlist_ip_array')->(Contains: (client_ip))]
[(global: 'hitlist_ip_array')->(insert: (client_ip))]
On donderdag, 2 juni 2005 17:09, James Harvard <[hidden email]> wrote:
Have you looked for Apache modules to do this? I think that would be much faster / would have lower overheads, if there is an appropriate module available.
>Your example is exactly what I mean but I'm thinking more towards a global set with an array of IP's wich is cleared every two seconds or so
>This eliminates the need for lots off database calls.