Skip to content

MiguelGonzalez2/HTTPSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTPSync - A simple, fast web server in C.

This project is a simple webserver written in C that supports simple HTTP features and CGI. It was developed as part of the Communication Networks II subject at college. Authors: Alejandro Bravo de la Serna and Miguel González González.

Building the program

To build the server's executable, just run make from the project's root. Library confuse, which corresponds to package libconfuse-dev, needs to be installed. This will result in the file server.

Configuration

The server.conf file allows to tweak certain parameters:

  1. server-root : Path, relative to the program's file, that will store the web contents. Files above this path will never be returned by the server.
  2. max-clients : Maximum number of clients that can connect to the server in a given moment. More connections will result in waits or refusings, as specified in listen-queue
  3. listen-port : Must be an unusued port in which the server will start listening.
  4. server-signature : Server name that will be included in response header files.
  5. daemon-mode : Determines whether the server shall run "as is" (0) or should launch itself as a daemon (1). In any case, server output will be produced in the system log (syslog).
  6. listen-queue : Number of incoming connections that will be put on hold, in case max-clients has been attained, before starting to refuse.
  7. read-timeout : Number of seconds that will be waited before sending a 408 request timeout on nonresponding clients.

Running the server

It suffices to include the website objects in the server-root path and run the server. The website root shall be named index.html.

In order to properly stop the server, it must be signaled with a SIGINT. If running on an active terminal, this can be achieved by pressing Ctrl+C. Otherwise, use the kill command (kill -INT ). A shell script, killServer.sh, is included to automatically send the signal to the server. (CAUTION. Be aware that if other processes have the same name as the server one, they might be signaled as well. Script was included for debugging convenience, and shall never be used to stop the server in serious environments).

Features and future improvements

Kindly refer to the project's wiki to find out about what is supported, some details about the design, and some possible future roadmap.

About

HTTPSync -- A simple, fast web server in C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages