A versatile and efficient C web server featuring non-blocking sockets, CGI support, and HTTP functionalities.
- Non-Blocking Sockets: Utilizes non-blocking socket programming to handle multiple simultaneous connections without the need for multi-threading.
- HTTP Methods: Supports GET, POST, and DELETE requests, allowing it to serve, accept, and delete data respectively.
- CGI Support: CGI support to execute programs and scripts (
.py
only), enabling dynamic content generation. - Directory Listing: Automatically lists the contents of a directory when no index file is found.
- Error Pages: Appropriate error responses/status codes (like 200, 404 or 500). For valid/invalid requests.
- Redirection: Supports HTTP redirections.
- Logger: Includes a comprehensive logging system to track requests, responses, and server information.
- Virtual Hosts: Virtual hosting allows multiple domains to be hosted from a single server config.
- UI for Testing: A basic yet visually appealing UI is provided to test and demonstrate server functionality.
- Documentation: All functions have doxygen comments to ensure readability and to better understand the underlying logic at a glance.
Ensure you have a C compiler installed beforehand
- Clone the repo
git clone https://github.com/RealConrad/42webserv.git
- Enter directory and compile program
cd 42webserv
make
- Running the server
NOTE: If no config is specified, it will run the default config located at:
/configs/default.config
. You can specify a config file with./webserv <path-to-config-file>
./webserv
- Open it on chrome
NOTE: Change host name and port to whats specified inside the config file. The example shown will work for
default.config
http://localhost:8080
For a list of resources used, check out our wiki page here.
Click here or view the License Tab.