A simple webserver written in C. See todo.txt for immediate priorities for what needs to be done.
- Install the required dependencies (see Dependencies below).
- Build and install:
You may need superuser privileges for
make make install
make install.
Basic command:
ws67 [options] <website_root>Full form:
ws67 --port <port> --config <config_path> <website_root>Short flags:
-p = --port
-c = --config
The server uses exactly one configuration file, selected in this order:
- Path provided via
--config ./config.yml/etc/webserver67/config.yml
If none of these exist, the server runs with defaults.
Note: Configuration files are not merged. Only one is loaded.
Command-line arguments override values from the selected config file:
--port overrides the configured port
<website_root> overrides the configured root directory
All command-line arguments are optional. If omitted, values are taken entirely from the config file.
ws67
ws67 -c ./myconfig.yml # the site root can be omitted and just use the config
ws67 -p 8080 ./public
ws67 -c ./config.yml ./siteAll of these should present on most Linux distributions except LibCYAML.
- LibCYAML v1.4.2
- Zlib v1.3.2.1 (compression)
- C Standard Library
- Make
- GCC
- Receives HTTP requests
- Processes control data (i.e. first line)
- Processes a limited set of request headers
- Serve static files over HTTP
- Can serve many common filetypes used on the web
- Directory browsing
- Reads YAML config files
- Can receive overrides from command line arguments
- Read requests of unlimited size
- Chunked transfer coding in responses (not requests)
- Process more types of request headers
- Reverse proxy
- Allow subdirectories to have their own index.html files
- Only supports HTTP/1.1
- Things like processing control data become more annoying in later versions
- Only supports unix systems
- Socket-related functions are in different headers on windows
- Relies on unistd.h and time.h, unistd is unix-specific and time functions are different on windows
- Does not support chunked transfer coding
- Assumes content is just one giant blob sent with the request