Ruby HTTP Server from scratch | Mike Perham
06-Oct-2023 532
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 #scratch #Perham #server https://rubyonrails.ba/link/ruby-http-server-from-scratch-mike-perham