How aweh-github/webserv works
Webserv is a C++98, event-driven HTTP/1.1 server. Its main workflow is to load server/location configuration, accept connections, parse and route requests, then produce responses from files, directory listings, uploads, redirects, or CGI output. The README documents the supported methods, limits, and virtual-host behavior. The graph uses the sampled main loop and client/config excerpts where available; several feature links rely on README statements because their implementation excerpts were not provided.
Main entry points: Client.cpp Client Connection · main.cpp Server Entry · WebServ.cpp Poll Server · Get.cpp GET Handling
Components 19
Configuration
- Config Parser
src/Config/__internal__.cpp - Server Config
src/Config/Server.cpp - Location Config
src/Config/Location.cpp
Event Runtime
- Server Entry
src/main.cpp - Poll Server
src/Exec/WebServ.cpp - Listening Socket
src/Exec/Socket.cpp
HTTP Handling
- Client Connection
src/Exec/Client.cpp - Host and Location Routing
src/Exec/Client.cpp - HTTP Responses
src/Exec/Response.cpp
Content and CGI
- GET Handling
src/Exec/Get.cpp - Directory Index
src/Exec/Index.cpp - POST Uploads
src/Exec/Post.cpp - DELETE Handling
src/Exec/Client.cpp - Redirect Handling
src/Exec/Redirection.cpp - CGI Execution
src/Exec/Cgi.cpp - Page Builder
src/Exec/WebPage.cpp
Other components
- Server Operator
- Website Files
- CGI Interpreter
Connections 22
- Server Operator → Server Entry: starts
- Server Entry → Config Parser: parses config
src/main.cpp - Config Parser → Server Config: builds config
- Server Config → Location Config: stores locations
src/Config/Server.cpp - Server Entry → Poll Server: starts server
src/main.cpp - Poll Server → Listening Socket: opens listeners
- Poll Server → Client Connection: dispatches events
- Client Connection → Host and Location Routing: selects host
src/Exec/Client.cpp - Host and Location Routing → Server Config: looks up server
src/Exec/Client.cpp - Host and Location Routing → Location Config: selects location
src/Exec/Client.cpp - Client Connection → GET Handling: handles GET
- GET Handling → Website Files: reads files
- GET Handling → Directory Index: lists directories
- Directory Index → Page Builder: builds listing
src/Exec/Index.cpp - Client Connection → POST Uploads: handles POST
- POST Uploads → Website Files: stores uploads
- Client Connection → DELETE Handling: handles DELETE
src/Exec/Client.cpp - Client Connection → Redirect Handling: applies redirect
- Client Connection → CGI Execution: runs CGI
- CGI Execution → CGI Interpreter: invokes interpreter
- Client Connection → HTTP Responses: builds response
- HTTP Responses → Website Files: reads error pages