1 # frozen_string_literal: false
2 # Inlined rack app using yahns server (git clone git://yhbt.net/yahns.git)
3 # Usage: yahns -c /path/to/this/file.conf.rb
4 # There is no separate config.ru file for this example,
5 # but rack_app may also be a string pointing to the path of a
9 rack_app = Rack::Builder.new do
11 addr = %w(0.0.0.0:9418 0.0.0.0:443 [::]:443 0.0.0.0:80 [::]:80
12 127.0.0.1:6081 127.0.0.1:280 0.0.0.0:119 [::]:119)
13 use Raindrops::Middleware, listeners: addr
14 run Raindrops::Watcher.new(listeners: addr)
16 # rack_app = '/path/to/config.ru' # a more standard config
18 app(:rack, rack_app) do
19 # I keep IPv4 and IPv6 on separate sockets to avoid ugly
20 # IPv4-mapped-IPv6 addresses:
22 listen '[::]:8080', ipv6only: true
23 client_max_body_size 0 # no POST or any uploads
25 output_buffering false # needed for /tail/ endpoint to avoid ENOSPC
26 queue { worker_threads 30 }
29 # logging is optional, but recommended for diagnosing problems
30 # stderr_path '/var/log/yahns/stderr-raindrops.log'
31 # stdout_path '/var/log/yahns/stdout-raindrops.log'