simple python web proxy server -- 2
Budget: $30 – $250 USD
Use Python to develop a small web proxy server that is able to cache web pages. It is a very simple proxy server that only understands simple GET requests of .html files.
With Python, there are various solutions and libraries for a web proxy. In this project, only the following four libraries/functions are allowed.
from socket import *
It’s okay to use all the functions in the socket lib
from urllib.parse import urlparse
Only this urlparse function can be used
import sys
For parsing argument (port number) only
from pathlib import Path
For folder access only
Your proxy supports only HTTP 1.0 and expects a request message with only a GET request line. Upon receiving a client’s HTTP 1.0 request, your proxy either loads the requested file from cache or requests the file from the server, and then sends it back to the client.
If the HTTP request is malformed or not supported or the server returned status other than 200 and 404, your proxy should return 500 'Internal Error' to the client.
With Python, there are various solutions and libraries for a web proxy. In this project, only the following four libraries/functions are allowed.
from socket import *
It’s okay to use all the functions in the socket lib
from urllib.parse import urlparse
Only this urlparse function can be used
import sys
For parsing argument (port number) only
from pathlib import Path
For folder access only
Your proxy supports only HTTP 1.0 and expects a request message with only a GET request line. Upon receiving a client’s HTTP 1.0 request, your proxy either loads the requested file from cache or requests the file from the server, and then sends it back to the client.
If the HTTP request is malformed or not supported or the server returned status other than 200 and 404, your proxy should return 500 'Internal Error' to the client.