~/talk

Let's build a simple HTTP server with Ruby

Talkat RubyConf 2019 · 2019-11-18..11-20· [ruby, web-platform]
links:none on file
slides:none on file

Code builds a working but minimal HTTP server in Ruby using the stdlib Socket class it binds to port 5000 accepts connections with TCPServer reads full requests via readpartial parses the request line and headers into a hash serves files from a server root and even executes an executable .rb file the implementation returns 200 or 404 as plain HTTP strings is explicitly non spec compliant and remains vulnerable to path traversal attack so use Socket class for learning and Rack for production.

AI-written summary · about

  1. 0:00Introduction
  2. 0:48About me
  3. 2:00What is the Internet
  4. 3:30What is HTTP
  5. 4:27HTTP specification
  6. 5:30URL syntax
  7. 9:40Socket
  8. 11:54Server
  9. 18:15Send response
  10. 19:24Respond with
  11. 21:36Response class
  12. 27:14Demo
  13. 28:10Execute a Ruby file
  14. 28:43Modify the response parser
  15. 30:43Missing features
  16. 31:18Path traversal attack
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.