Sha256: 15af09b9009b79643762af631c9924d2b5779c458f667326c872009d0970a901

Contents?: true

Size: 371 Bytes

Versions: 2

Compression:

Stored size: 371 Bytes

Contents

require 'rack/congestion'

# Limit requests to
#   - a maximum of 10 requests per minute
#   - a maximum rate of 1 request every second
#   - Unsuccessful requests count towards limits
use Rack::Congestion::Limiter, {
  interval: 60, max_in_interval: 10, min_delay: 1,
  track_rejected: true
}

run ->(env){
  [200, { 'Content-Type' => 'text/plain' }, ['Hello world']]
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-congestion-0.0.3 examples/global.ru
rack-congestion-0.0.2 examples/global.ru