Skip to content

guomaimang/Silver-Spork

Repository files navigation

Silver-Spork

COMP2322(CN) Project

A small HTTP Server (Networking Project & Socket Programming)

Java 16 + intellJ Idea + Postman

img img img

  • Document: https://guomaimang.github.io/note/cs/cn/java-socket-programming

  • Demo: http://cn2322.hanjiaming.com.cn:8082

  • Use Java Muti-Thread to process socket

  • Create a connection socket when contacted by a client (browser)

  • Receive the HTTP request from this connection

  • Parse the request to determine the specific file being requested

  • Get the requested file from the server’s file system

  • Proper request and responsemessage exchanges

  • Create an HTTP response message consisting of the requested file preceded by header lines;

  • Can't use the HTTPServer class directly

  • Only process GET and HEAD request

  • Only response HTTP1.1 200, 400, 404, 304

  • Handle Last-Modified and If-Modified-Since headerfields

  • Handle Connection: Keep-Aliveheader field

With

  • A good summary.
  • A clear README text file
  • High quality.
  • A full demonstration.