IK1203 Networks and Communication, 7.5 credits at KTH Royal Institute of Technology
Code developed by Tenzin Sangpo Choedon, Spring 2025 (Republished)
Skeleton declaration provided by KTH
This project implements networking applications through the socket API. This entails designing the client and server side of the client-server communication architercture. The client side is a general-purpose TCP client that can communicate with servers through different application protocols. The web server in this project processes the http requests through calling TCPClient.askServer(). This HTTPAsk server is also concurrent which implies it can process the request of multiple clients in parallel. The HTTP request can be made in the web broswer and the resulting HTTP response is displayed in the web browser.
root/
βββ tcpclient/
β βββ TCPClient.java
βββ ConcHTTPAsk.java
βββ MyRunnable.java
βββ README.md
βββ .gitignore
Java 18
-
Required Java version:
sudo apt install openjdk-18-jdk
curl
-
Install curl using:
sudo apt install curl
Run the scripts in this order:
- Client connects with a TCP server through terminal
java TCPAsk time.nist.gov 13
- Run the HTTPAsk server
java ConcHTTPAsk 8888
- Open TCP connection through web-based approach and send GET request
curl http://hostname.domain/ask?hostname=time.nist.gov&limit=1200&port=13