This repository has been archived on 2021-08-17. You can view files and clone it, but cannot push or open issues or pull requests.
unix/http
Ivaylo Ivanov 72fb0784bf Refactor the client 2018-11-27 11:29:57 +01:00
..
public Add functioning server 2018-11-09 21:46:52 +01:00
shared Add basic client socket config 2018-11-03 20:13:23 +01:00
Makefile Fix bug in client and change the Makefiles 2018-11-10 21:18:12 +01:00
README.md Add initial server functionality and clean up 2018-11-06 19:45:29 +01:00
client.c Refactor the client 2018-11-27 11:29:57 +01:00
server.c Make the server listen constantly and fix a bug 2018-11-10 14:07:08 +01:00

README.md

http

The aim of these two modules is to implement a client and a server that partially implement HTTP 1.1

client

The client takes a URL as input, connects to the corresponding server on the corresponding port(80 by default) and requests the file specified in the URL. The transmitted content of that file is written to stdout, to a file or to a directory.

SYNOPSIS
client [-p PORT] [ -o FILE | -d DIR ] URL

EXAMPLE
client http://ivayloivanov.eu/en/

server

The server takes a document root as input, reads it and serves it on the port specified(8080 by default). If the -i flag is specified, the server uses its value as an index file. If not, it takes index.html as a default. The server supports ONLY GET requests. If it receives another request type it will return a response status 501 (Not implemented). If the file requested is not found, the server returns a response status 404 (Not found).

SYNOPSIS
server [-p PORT] [-i INDEX] DOC_ROOT
EXAMPLE
server -p 1280 -i index.html ./public/

Note: The description is from the task I got from TU.