- No libraries other than JDK
- HEAD, GET, DELETE available
- OOP applied for the each method implementation (HeadRequestHandler, GetRequestHandler, and DeleteRequestHandler extends RequestHandler)
- Logging availble
- Multithreading available
Add resourse path and port and then run the WebServerMain!
-
HTML
-
JPG
curl -s -I -X GET localhost:54321/index.html
curl -X DELETE localhost:54321/beer.jpg
LogUtil is implementation for logging. Under /log/ directory, log file will be created (if not exist) and log text will be added.
-------------------- Client Request Log --------------------
Client IP : /0:0:0:0:0:0:0:1
Date/Time : 2023-06-07T20:54:20.019
Request Line : GET /noFileWithThisName.html HTTP/1.1
Server Response : HTTP/1.1 404 Not Found Requested path doesn't exist
-------------------- Client Request Log --------------------
Client IP : /0:0:0:0:0:0:0:1
Date/Time : 2023-06-07T20:54:23.716
Request Line : GET /beer.jpg HTTP/1.1
Server Response : HTTP/1.1 200 OK
-------------------- Client Request Log --------------------
Client IP : /127.0.0.1
Date/Time : 2023-06-07T20:57:35.133
Request Line : DELETE /beer.jpg HTTP/1.1
Server Response : HTTP/1.1 200 OK
- The main method for your server should take two command-line arguments, the directory from which your server will serve documents to clients and the port on which your server should listen.
- The server should support and respond correctly to HEAD requests.
- The server should support and respond correctly to GET requests.
- The server must be able to return HTML documents requested by a client.
- The server should respond with appropriate error messages when non-existent services or resources are requested.
- Returning of binary images (GIF, JPEG and PNG)
- Multithreading – support multiple concurrent client connection requests up to a specified limit
- Logging – each time requests are made, log them to a file, indicating date/time, request type, response code etc.
- Supporting other methods in addition to GET and HEAD





