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