https://github.com/benikk/http-server
Writing an HTTP server from scratch.
https://github.com/benikk/http-server
Last synced: 5 months ago
JSON representation
Writing an HTTP server from scratch.
- Host: GitHub
- URL: https://github.com/benikk/http-server
- Owner: BeNikk
- Created: 2025-05-26T16:11:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-27T14:39:05.000Z (about 1 year ago)
- Last Synced: 2025-08-23T15:26:46.774Z (11 months ago)
- Language: TypeScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Raw HTTP Server in TS
This project demonstrates how to create a basic HTTP server from scratch using Node.js's built-in TCP `net` module - without using any HTTP libraries or frameworks.
## What This Project Does
- Listens for incoming TCP connections on port 8124
- Manually parses raw HTTP request data (method, path, protocol)
- Routes requests based on the URL path (`/`, `/about`, `/profile`)
- Sends back simple HTTP responses with proper headers and body content
- Serves a static HTML file for the `/profile` route
- Handles basic errors and connection lifecycle events
- Logs all incoming request data and connection events to the console