How hyle4888887/42webserv works
Webserv is a configurable C++98 HTTP server. Its principal workflow parses configuration at startup, opens listeners, receives and parses client requests, applies route-specific behavior, and returns HTTP responses; configured CGI requests run an external interpreter. The graph preserves documented static serving, uploads, redirects, directory listings, and error pages. Several runtime files were not excerpted, so their links rely on README statements; edges are omitted where neither excerpts nor documentation establish a relationship.
Main entry points: handle.cpp Route and method handling · build.cpp HTTP response building · configParser.cpp Config parser · main.cpp Program entry
Components 23
Configuration
- Config lexer
parser/lexer.cpp - Config parser
parser/configParser.cpp - Server and route settings
parser/serverConfig.hpp
Server runtime
- Program entry
main.cpp - Listener sockets
server/socket.cpp - Poll event loop
server/server.cpp - Client I/O
server/handleOperation.cpp
HTTP handling
- Request parsing
HTTP/HTTP.cpp - Route and method handling
HTTP/handle.cpp - HTTP response building
HTTP/build.cpp - Response formatting
HTTP/response.cpp - File downloads
server/buildHTTP.cpp
CGI execution
- CGI dispatch
server/handleCGI.cpp - CGI process startup
CGI/start.cpp - CGI response conversion
CGI/buildResponse.cpp
Content and errors
- Static files and listings
HTTP/handle.cpp - Uploads and deletion
HTTP/handle.cpp - Redirect handling
HTTP/build.cpp - Error pages
HTTP/response.cpp
Other components
- Server operator
- Config file
config/conf_default - HTTP client
- CGI interpreter
Connections 25
- Server operator → Config file: selects
README.md - Program entry → Config parser: parses config
main.cpp - Config file → Config parser: provides directives
README.md - Config parser → Config lexer: tokenizes via
README.md - Config parser → Server and route settings: builds settings
- Program entry → Listener sockets: opens listeners
main.cpp - Program entry → Poll event loop: runs server
main.cpp - Server and route settings → Listener sockets: configures binds
- Poll event loop → Client I/O: dispatches I/O
server/server.cpp - HTTP client → Listener sockets: connects to
README.md - Client I/O → Request parsing: parses request
README.md - Request parsing → Route and method handling: provides request
README.md - Server and route settings → Route and method handling: configures routes
README.md - Route and method handling → HTTP response building: selects response
README.md - HTTP response building → Response formatting: formats response
- Route and method handling → Static files and listings: serves files
README.md - Route and method handling → Uploads and deletion: handles methods
HTTP/handle.cpp - HTTP response building → Redirect handling: builds redirects
README.md - HTTP response building → Error pages: uses error pages
README.md - Poll event loop → File downloads: assembles response
README.md - Route and method handling → CGI dispatch: dispatches CGI
README.md - CGI dispatch → CGI process startup: starts process
README.md - CGI process startup → CGI interpreter: executes script
README.md - CGI dispatch → CGI response conversion: converts output
README.md - HTTP response building → HTTP client: returns response