Many developers at some point in their programming career get curious about how HTTP servers work and how to build one from scratch without any external libraries.
Well, recently, I got curious about “How do HTTP servers work”? “How are HTTP servers built?” and “Can I build an HTTP server and client with Ruby without using any gems?“
And you know what, the answers are, yes, yes and yes!We’ll explore how to build a simple http server using the Socket class available in the Ruby’s standard library. In the process, we will also get a crash course on how HTTP works.