How to block a client address in KTor server?
I am using a rate limiter and want to restrict/ban/block a client IP address from contacting my server.
I want this to protect my server from going down during a brute force attack of millions of requests per minute.
How do I programatically block and unblock a client IP so that my server resourcse are not wasted?
install(RateLimit) {
global {
rateLimiter(limit = 10, refillPeriod = 10.seconds)
requestKey { call → call.request.origin.remoteAddress }
}
}
install(StatusPages) {...