How yosskavo/webserv works
Webserv is a non-blocking HTTP/1.1 server configured with NGINX-style files. The principal workflow is: a browser sends a request; the server loads configuration, parses and routes the request, then serves a file, performs a mutation, or invokes CGI before returning an HTTP response. The graph also preserves documented uploads, auto-indexing, cookies, custom errors and the test dashboard. Runtime wiring beyond the excerpts is limited; documented capability links cite the README rather than implying that unsampled implementation details were inspected.
Main entry points: Server_response.cpp Response building · Server_route.cpp Virtual-host routing · Server_static.cpp Static files · Server_cgi.cpp CGI process handling
Components 19
Startup and configuration
- Server entry
main.cpp - Config parser
parce/file/parce.cpp - Server configuration
config/site.conf
HTTP server
- Poll and sockets
server/Server_core.cpp - Request parsing
parce/request/headers.cpp - Cookie parsing
parce/request/cookies.cpp - Virtual-host routing
server/Server_route.cpp - Response building
server/Server_response.cpp
Content and execution
- Static files
server/Server_static.cpp - Directory indexing
server/Server_static.cpp - POST and DELETE
server/Server_modify.cpp - Site and uploads
site - CGI process handling
server/Server_cgi.cpp - CGI output parsing
parce/cgi/cgi.cpp - Python and PHP scripts
site/cgi - Error pages
site/errors
Browser and sessions
- Test dashboard
site/index.html - Cookie session UI
site/cookies.js
Other components
- Browser
Connections 23
- Browser → Test dashboard: opens
README.md - Test dashboard → Browser: sends requests
README.md - Server entry → Config parser: parses config
main.cpp - Server configuration → Config parser: provides directives
README.md - Server entry → Poll and sockets: starts server
main.cpp - Browser → Poll and sockets: sends HTTP
README.md - Poll and sockets → Request parsing: reads request
- Request parsing → Cookie parsing: parses cookies
parce/request/headers.cpp - Request parsing → Virtual-host routing: routes request
- Virtual-host routing → Static files: serves GET
README.md - Virtual-host routing → POST and DELETE: dispatches methods
README.md - Static files → Site and uploads: reads files
README.md - Static files → Directory indexing: generates listings
README.md - POST and DELETE → Site and uploads: uploads or deletes
README.md - Virtual-host routing → CGI process handling: dispatches CGI
README.md - CGI process handling → Python and PHP scripts: executes scripts
server/Server_cgi.cpp - CGI process handling → CGI output parsing: parses output
parce/cgi/cgi.cpp - Static files → Response building: builds response
- POST and DELETE → Response building: builds response
- CGI process handling → Response building: builds response
server/Server_cgi.cpp - Response building → Error pages: uses custom errors
README.md - Response building → Browser: returns HTTP
- Cookie parsing → Cookie session UI: supports sessions
README.md