CMPE 142 San Jose State University Web Server Process C Programming Task
Question Description
Write a web-server process that replies to HTTP GET requests involving html files in the current directory where you process is started. Example of the type of GET requests your process will get is shown toward the end. Your process will receive a (TCP) port as an argument where it must accept and server incoming TCP connections.
You should be able to test your server using your web browser and pointing it to the server (i.e. http://127.0.0.1:YourPortNumber)
When testing we will provide the html file your server will use so you just submit your C code.
Your code will implement a TCP server that accepts connections at a port specified via command line argument -p. Once it received an incoming connection your server will have to read the incoming request and parse the HTTP GET request and then return the requested file (i.e. hello.html). If file does not exist, your program must return a proper HTTP error code for this condition. You must support this for HTTP 1.1 and HTTP 1.0
GET /hello.htm HTTP/1.1User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)Host: www.tutorialspoint.comAccept-Language: en-usAccept-Encoding: gzip, deflateConnection: Keep-Alive
"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."