Skip to content
This repository was archived by the owner on Nov 7, 2021. It is now read-only.

justinmcbride/Networking_1

Repository files navigation

Justin McBride
HTTP Server

GENERAL NOTES
-------------
a. I make use of two libraries:
  1. Libevent (discussed under Requirements)
  2. easylogging++ (easyloggingpp.h)
    This is a logging library to output information at various
    levels to the console. It supports color-coded output and
    runtime enabling of different logging levels. By default,
    only select information is printed out, but running the 
    server with the -v flag will enable verbose logging.

b. The app by default looks for "ws.conf" in the main directory,
   but this can be modified with the -c option.

c. I also included a test site that I made to test many simultaneous
   connections at once, under the www-Many/ directory. It has 50 images
   that need to be fetched individually. Under my testing, both Chrome
   and Firefox would only open 6 connections each.

REQUIREMENTS
------------
My assignment uses the C library known as Libevent to handle multiple sockets
and all the connections between them. It handles the implmenetation of creating
and binding the sockets, as well as reading and writing to them. I receive a
callback everytime a socket is ready to be read from, and then parse the requests
and handle them appropriately.

To download Libevent, on a Ubuntu/Debian machine, execute
$ sudo apt-get install libevent-dev

Additionally, the code compiles only under C++11.

BUILDING
--------
g++ --std=c++11 -o http_server_mcbride McBride_Server.cpp -levent

RUNNING
-------
http_server_mcbride [-c config_file] [-v] [--v={1-9}]

With the -c option, you can specify the path to the configuration file.
Without it, it defaults to './ws.conf'

The verbosity level of logs is selectable with the v command
options above. 

By default, verbose logging is not enabled. The messages printed
out then are only for served pages and HTTP errors, as well as
any general errors.

With level 1 verbose logging, basic HTTP request information is printed out,
as well as when connections are opened and closed, and why. The configuration
file processing will be printed out as well.

With level 2, more detailed HTTP request parsing is also printed out,
and other processing.

With level 3, all headers of HTTP requests are also printed.

The lone '-v' option enables maximum verbosity.





About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published