The server should be called as follows:
# ./bashwebserver.sh port [root]
Where port is a mandatory argument to specify the port number the server should listen on, and root
is an optional argument to specify the web server's root directory.
P.S:
● If the root directory is not specified, use the current directory as root
● Use the netcat (sometimes called nc) command to listen on incoming connections
● The web server should at least understand the HTTP GET command
● The web server should correctly return the following status codes: 200 OK, 403
FORBIDDEN, 404 NOT FOUND
● The web server should correctly return a Content-Type header, at least for text/plain,
text/html and application/octet-stream (for all files which do not match any of the
other content types)
● If the web server receives a request for a directory, it should return a directory listing (does
not need to have clickable links). Optionally, you can return an index.html file instead, if
one exists.
any guide is appreciated