Ruby HTTP Server from scratch | Mike Perham

Recently I decided to add support for Kubernetes HTTP health checks to Sidekiq Enterprise. This means, within each Sidekiq worker process, we need to implement an HTTP server which listens on port X and simply returns 200/OK if the process is alive.Notice we have really basic requirements here: no need for serving files or arbitrary dynamic content. We only respond to “/” so there’s no need for routes, paths or query parameter handling. Because the health check should only be used within private networking, we have no need for TLS or https support.I didn’t want to bring in a dependency on Puma, Thin or some other “big” Ruby HTTP server. How can we implement this with only Ruby’s standard library?.
Ruby HTTP Server from scratch | Mike Perham #ruby #rubydeveloper #rubyonrails #server https://rubyonrails.ba/single/ruby-http-server-from-scratch-mike-perham

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles