Newb here: have you written your own web server? Seeking advice

This page summarizes the projects mentioned and recommended in the original post on /r/ruby

Scout Monitoring - Performance metrics and, now, Logs Management Monitoring with Scout Monitoring
Get early access to Scout Monitoring's NEW Ruby logging feature [beta] by signing up now. Start for free and enable logs to get better insights into your Rails apps.
www.scoutapm.com
featured
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
  • mongrel

    Mongrel on git

    The other major thing you'll run into is performance. WEBrick's HTTP parsing code may look hairy but it is fast. Mongrel was the first Ruby HTTP server to implement it's HTTP parser in C using Ragel, which Thin, Unicorn, and Puma all copied; although there's a bug in the original Mongrel HTTP parser where it does not combine the values duplicate HTTP headers (yes, HTTP Header names can actually be repeated).

  • Scout Monitoring

    Performance metrics and, now, Logs Management Monitoring with Scout Monitoring. Get early access to Scout Monitoring's NEW Ruby logging feature [beta] by signing up now. Start for free and enable logs to get better insights into your Rails apps.

    Scout Monitoring logo
  • Puma

    A Ruby/Rack web server built for parallelism

    The other major thing you'll run into is performance. WEBrick's HTTP parsing code may look hairy but it is fast. Mongrel was the first Ruby HTTP server to implement it's HTTP parser in C using Ragel, which Thin, Unicorn, and Puma all copied; although there's a bug in the original Mongrel HTTP parser where it does not combine the values duplicate HTTP headers (yes, HTTP Header names can actually be repeated).

  • webrick

    HTTP server toolkit

    WEBrick. Written entirely in Ruby, this is where you should start your examination, but not where it should end. WEBrick is easy to understand, because it is all Ruby, but it is not suitable for hosting websites. It is not robust or performant enough.

  • bindata

    BinData - Reading and Writing Binary Data in Ruby

    For example, I enjoy sim racing, and some of my games provide a network API for things like telemetry data. So I wrote a simple telemetry logger that I use to gather data, which I then mess around with using R Studio. Ruby worked exceptionally well for this because of a cool little library called BinData.

  • ruby_view_server

    You don’t need to implement a server from scratch. Here’s an exercise I wrote about wiring the HTML generating bits of Ruby code together you might find interesting https://github.com/schneems/ruby_view_server

  • net-http-server

    A pure Ruby HTTP Server.

    Yes, I actually have. Implementing a basic HTTP parser isn't that difficult, once you implement the correct parsing rules from RFC 9110. If you want to fully support the HTTP protocol, you also have to implement things such as Chunked Transfer Encoding or Gzip Deflate.

  • Thin

    A very fast & simple Ruby web server

    The other major thing you'll run into is performance. WEBrick's HTTP parsing code may look hairy but it is fast. Mongrel was the first Ruby HTTP server to implement it's HTTP parser in C using Ragel, which Thin, Unicorn, and Puma all copied; although there's a bug in the original Mongrel HTTP parser where it does not combine the values duplicate HTTP headers (yes, HTTP Header names can actually be repeated).

  • CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  • tracks

    A bare-bones Ruby HTTP server that talks Rack and uses a thread per connection model of concurrency. (by matsadler)

    My server is on GitHub here: https://github.com/matsadler/tracks

  • http_tools

    Pure Ruby HTTP parser and friends

    And the HTTP parser I wrote for it: https://github.com/matsadler/http_tools

  • Rack

    A modular Ruby web server interface.

    The spec for Ruby's Rack is another good reference for how a Ruby webserver is expected to work.

  • EventMachine

    EventMachine: fast, simple event-processing library for Ruby programs

    Maybe check out EventMachine. You can roll your own using sockets if you don't want to use a library.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Would you consider Rails as stable nowadays ?

    2 projects | /r/rails | 8 Dec 2023
  • Recommended way to implement Puma plugin configuration

    1 project | /r/ruby | 2 Jun 2023
  • Welcome to Puma 6: Sunflower

    1 project | /r/hypeurls | 22 Oct 2022
  • Welcome to Puma 6: Sunflower

    1 project | news.ycombinator.com | 22 Oct 2022
  • puma 6.0 released

    2 projects | /r/ruby | 21 Oct 2022

Did you konow that Ruby is
the 12th most popular programming language
based on number of metions?