Skip to content

UCLA-CS130/p

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Server

A simple web server, using boost.

Usage

To run server:

$ make
$ sudo ./webserver config

To run unit tests and get coverage:

$ make unit_test_coverage

To run integration test:

$ make integration_test

To clean up:

$ make clean

Use your browser to view pages:

  • Echo server: http://localhost:8080/echo/
  • Static file server: http://localhost:8080/static/image0.jpg
  • Static file server for markdown: http://localhost:8080/markdown/README.md
  • Status server: http://localhost:8080/status/
  • Database interface: http://localhost:8080/database/index.html

Source code layout

  • Webserver: A webserver is responsible for listening to sockets, accepting connections, processing requests, generating responses and replying to client.
  • Request: The request follows the common API. It can be generated by parsing the raw_request string.
  • Response: The response follows the common API.
  • RequestHandler: The RequestHandler follows the common API.
  • EchoHandler: An EchoHandler inherites from RequestHandler. It echos back the raw request received.
  • StaticHandler: A StaticHandler inherites from RequestHandler. It servers static files.
  • NotFoundHandler: A NotFoundHandler inherites from RequestHandler. It responds the 404 messsge.
  • StatusHandler: A StatusHandler inherites from RequestHandler. It displays information on the status of the web server.
  • Log: A singleton class that serves as a log which the server and different handlers can write to the status information and then the status handler can read from to construct the response message.

The unit tests for each class and an integration test in python can be found in tests folder.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6