The codebase written in C, implements two servers that serve requests for HTTP/1.1.
The first server (s1) uses TCP as the transport protocol while the second server (s2) uses UDP instead.
- Both the servers are concurrent i.e. they are able to serve multiple HTTP requests simultaneously.
- For s1: The HTTP response is a web-page having a form with one text input. After the text is entered, s1 updates the web-page by displaying the entered text.
- For s2: The HTTP response is a web-page displaying the text “EE-4210: Continuous assessment”.
- Non-standard ports are used.
- The HTTP headers are constructed as a string in this implementation without the use of any external libraries/API.
To test out the TCP Server:
- Compile by: gcc s1_server.c - lm - o s1
- Exe as: ./s1
- Head over to : http://localhost:1200/
- Type in any input into the field displayed, hit ENTER and the server should return a response that displays your input.
To test out the UDP Server:
- Compile by: gcc s2_server.c - lm - o s2
- Exe as: ./s2
- You can use software such as netcat(nc) to send requests to the server at port 1600. Alternatively you could write your own simple client for testing.
- Server returns a HTTP response of a web-page displaying the text “EE-4210: Continuous assessment”
NOTE: Since web browsers use TCP by default, you will not be able to use your usual web browser for connecting to a UDP server.