π§ Ever wondered what really happens before http.createServer() in Node?
I did β and decided to dig way deeper.
While working on my server recently, a thought struck me:
Can I build this from even lower down? Like, handle the raw socket connections myself β understand the handshake, data transfer at the byte level, and have full control over every bit sent and received.
So thatβs exactly what I started doing:
β
Handling raw TCP data streams
β
Parsing HTTP methods, paths, and headers manually
β
Building a response engine without relying on the http module
β
Rewriting my Trie-based router to work directly on top of TCP sockets
Most devs just use express() or http.createServer().
But I wanted to know β whatβs really going on underneath?
This deep dive is teaching me:
β How TCP connections work from the ground up
β How net.Socket behaves internally
β How to build custom servers, proxies, or mini frameworks from scratch
Here is the Github Gist for the sample of the new implementation :
Top comments (0)