Skip to content

Add Nginx-like HTTP server example#80

Open
PeimonBot wants to merge 2 commits intoadityarao2005:mainfrom
PeimonBot:feature/http-server-example
Open

Add Nginx-like HTTP server example#80
PeimonBot wants to merge 2 commits intoadityarao2005:mainfrom
PeimonBot:feature/http-server-example

Conversation

@PeimonBot
Copy link
Contributor

Adds a minimal Nginx-like HTTP server example using the WebCraft async API.

Included:

  • examples/http_server/: TCP listener, per-connection handlers (fire_and_forget), async request reading, static file serving with path sanitization
  • GET/HEAD support, 200/404/405 responses, Content-Length/Content-Type
  • Fix in tcp_listener::accept() (socket.hpp) to return tcp_socket as intended
  • WEBCRAFT_BUILD_EXAMPLES option and examples subdirectory in root CMakeLists.txt

Build: cmake -S . -B build -DWEBCRAFT_BUILD_EXAMPLES=ON && cmake --build build
Run: ./build/examples/http_server/http_server [DOC_ROOT] [PORT] (default port 8080)

Made with Cursor

@vercel
Copy link

vercel bot commented Feb 16, 2026

Someone is attempting to deploy a commit to the Aditya's projects Team on Vercel.

A member of the Team first needs to authorize it.

@PeimonBot PeimonBot force-pushed the feature/http-server-example branch from d038058 to 0aa85d7 Compare February 16, 2026 05:37
PeimonBot and others added 2 commits February 16, 2026 05:55
Co-authored-by: Cursor <cursoragent@cursor.com>
…EADME

Co-authored-by: Cursor <cursoragent@cursor.com>
@PeimonBot PeimonBot force-pushed the feature/http-server-example branch from b1915f9 to b6eabc6 Compare February 16, 2026 05:55
@adityarao2005 adityarao2005 requested review from Copilot and removed request for Copilot February 16, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant