-
Caching:
The proxy server caches the content it retrieves from the web GET requests. If device wants to the same file, it retrieves it from the cache. It's advantages includes: Reduced network traffic, Reduced fetching time and Increased network performance -
Timeout handling:
It also has response timeout of 5s, if there's no response from the web server it automatically disconnects the connection. This prevents the server from hanging -
Multiple request handling:
The proxy server listen to multiple connections(max 5) simultenously.
The server listens on port 8888 for client requests. Once the client establishes a connection and send a GET request, the server parses the request to extract the hostname and path(Host: example.com, Path: /index.html). The server proceed to check the path(filename) across the cache directory, if it checks out. it send the cached file to the client. If there's no corresonding file in the cache, it forwards the request to the necessary web server to get the needed file.
The response from the web server is cached in the cache folder before being sent to the client.
Get request from the web server(http://httpbin.org/get)
Get request from the proxy cache
The web GET requests- curl


