/HTTP-Server

HTTP server capable of GET, HEAD, and POST requests based on RFC standards in C

Primary LanguageHTML

################################################################################
# README                                                                       #
#                                                                              #
# Description: HTTP/1.1 server implemented in C for Cornell's Networked        #
#              and Distributed Systems course (CS5450). Can handle multiple    #
#              clients and serve static files using GET, HEAD, and POST        #
#              requests. Also logs errors in a log file.                       #
#                                                                              #
# Authors: Jake Magid <jm2644@cornell.edu>,                                    #
#          Fani Maksakuli <fm399@cornell.edu>                                  #
#                                                                              #
################################################################################

A HTTP/1.1 server implemented in C using socket programming.

Supports HEAD, GET, POST, serve static file, log.


Description of Files
--------------------------------------------------------------------------------

Here is a listing of all files associated with the project and what their
purpose is:

                    .../README              - Current document
                    .../echo_client.c       - Simple echo network client
                    .../echo_server.c       - Simple echo network server
                    .../Makefile            - Contains rules for make
                    .../cp1_checker.py      - Python test script for CP1
                    .../lexer.l             - Parser implementation
                    .../parse.c             - Parser implementation
                    .../parse.h             - Parser implementation
                    .../parser.y            - Parser implementation
                    .../autolab_scripts/    - Autograder functions


How to Run
--------------------------------------------------------------------------------

To run the server first make, then call ./lisod with three arguments. Echo
client can be used to connect to the server given the port number. Make clean
can then remove the compiled files.

                    cd project-1/
                    make
                    ./lisod <HTTP port> <log file> <www folder>
                    ./echo_client localhost <HTTP port>

Instead of running echo_client, a curl request to the localhost address and port
can be used to execute GET, HEAD, or POST. Also the program Postman can be used.
When running inside a Docker container, ensure the container exposes the HTTP
ports to be able to use the Postman application on your machine's localhost.