class

Sellia::Server::CompositeRateLimiter

Inherits Reference / Object

Composite rate limiter for multiple limits

Constructors

new(limits : Limits = Limits.new, enabled : Bool = true)
Source

Instance methods

allow_connection?(ip : String) : Bool

Check if a new connection from IP is allowed

Source
allow_request?(tunnel_id : String) : Bool

Check if a request through tunnel is allowed

Source
allow_tunnel?(client_id : String) : Bool

Check if creating a new tunnel is allowed

Source
enabled
Source
enabled=(enabled : Bool)
Source
limits
Source
limits=(limits : Limits)
Source
remaining_connections(ip : String) : Float64

Get remaining connection tokens for IP

Source
remaining_requests(tunnel_id : String) : Float64

Get remaining request tokens for tunnel

Source
remaining_tunnels(client_id : String) : Float64

Get remaining tunnel tokens for client

Source
reset_client(client_id : String)

Reset limits when client disconnects

Source
reset_tunnel(tunnel_id : String)

Reset limits when tunnel closes

Source

Nested types