I would like to write a script that resends all http requests to a single, predefined hostname with the exact same same parameters that the script receives. The script must handle HEAD, GET and POST requests. For file uploads, the script could receive the incoming file, resend the incoming file to the predefined hostname, and if possible, send the received response body back to the caller.
The purpose of this script is to allow sending http requests to other ports than 80 for users that have a firewall or proxy server that only allow http request to port 80.
What is the easiest way to write such a script?