Skip to content

CodewithEvilxd/HTTP-SERVER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nishant Raw HTTP Server

Low-level HTTP/1.1 server built directly on top of Bun.listen() TCP sockets. This repository is maintained by Nishant Gaurav under the codewithevilxd identity.

Owner

Features

  • Incremental HTTP request parsing over raw TCP sockets
  • Proper request line and header validation
  • Content-Length body support
  • Branded JSON routes for /, /health, /about
  • POST /echo route for quick payload testing
  • Bun test suite and TypeScript typecheck support

Scripts

bun install
bun run start
bun run test
bun run typecheck

Additional helpers:

bun run start:udp
bun run inspect:asset

Routes

  • GET / returns project metadata and supported routes
  • GET /health returns a simple health response
  • GET /about returns owner details
  • POST /echo echoes the request body back to the client

Example

curl http://127.0.0.1:8080/
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/about
curl -X POST http://127.0.0.1:8080/echo -H "Content-Type: text/plain" -d "hello from nishant"

Notes

  • The TCP server always responds with Connection: close
  • Request bodies are decoded as UTF-8 text
  • Sample raw requests live in src/assets/

About

Low-level HTTP/1.1 server built directly on top of Bun.listen() TCP sockets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors