A web proxy is a service that sits between the client and the website and forwards all requests and responses between them. This includes files uploaded to a website.
A proxy with the intent to inspect or modify traffic is called an intercepting proxy. ZAP and Burp are examples of intercepting proxies. You can try one of them to show your file upload.
A proxy is typically only used if it is configured in the browser. It is sometimes possible to use a transparent proxy, where no client configuration is needed.
Whether a proxy can intercept all data, including file uploads, depends on the details of the SSL connection. If the website uses plaintext HTTP instead of HTTPS, everything can be intercepted. If the website uses HTTPS, there are two options:
- The browser performs a CONNECT request to the proxy. The proxy sets up a tunnel between the client and the website and only sees encrypted traffic. This way, the proxy can not intercept any traffic, because it is encrypted.
- The browser performs a CONNECT request, but the proxy sets up separate connections to the browser and the website. Now the proxy is a man-in-the-middle attacker that decrypts and re-encrypts any data is passed through. The proxy can intercept all data.
The problem with option 2 is that the SSL connection is intercepted, so your browser will complain that it is not connected to the right host, or that the certificate is invalid.
If you would want to implement a proxy in Python, I think you would start with a TCPServer. Implement one that listens on a port, configure your browser to use that port as proxy server, and watch what request is done.
Another project which can help you is mitmproxy, an intercepting proxy written in Python.