Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Let's build a simple HTTP server with Ruby by Esther Olatunde 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. #confreaks #rubyconf2019 #rubyconf
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this presentation titled 'Let's Build a Simple HTTP Server with Ruby', Esther Olatunde explores the fundamentals of HTTP and demonstrates how to create a simple HTTP server and client using Ruby without relying on any external libraries or gems. The key points discussed throughout the talk include: - **Introduction to HTTP:** Esther begins with an overview of HTTP, explaining it is a request-response protocol essential for communication between web browsers and servers. She outlines the history and evolution of HTTP from its early versions to the current proposals for HTTP 3. - **Understanding URLs:** The importance of URLs is highlighted, explaining how they uniquely identify resources on the web and the structure of a typical URL. - **Request-Response Cycle:** Esther describes how a browser sends HTTP requests to a server, which then responds accordingly, either serving the requested resource or relaying error messages when necessary. - **Socket Programming in Ruby:** A significant portion of the talk is dedicated to utilizing Ruby's Socket class, which allows for bidirectional communication. Esther explains the server's functionality to listen for connections, parse incoming requests, and send responses back to clients. - **Building a Simple HTTP Server:** Esther guides the audience through building a basic HTTP server by implementing listening capabilities, request parsing, and response generation. Key features discussed include: - Initializing a TCP server and binding it to a port (e.g., port 5000). - Reading and parsing incoming HTTP requests to extract the method, path, and headers. - Constructing appropriate responses based on request validity, including handling of 404 errors for non-existent paths. - Demonstrating the server's functionality using Curl to showcase the response process. - **Security Considerations:** The presenter briefly touches on vulnerabilities in the server implementation, specifically regarding path traversal attacks, and emphasizes the importance of security measures. - **Conclusion and Recommendations:** Esther concludes by suggesting the consideration of Rack for building more robust and production-ready servers in Ruby, acknowledging that Rack manages many complexities that the simplistic server lacks. She encourages the audience to further explore the HTTP specification, the Socket library, and documentation related to Rack. Overall, the presentation serves as a valuable resource for developers interested in understanding HTTP's mechanics and gaining hands-on experience with building a server using Ruby.
Suggest modifications
Cancel