There isn't any problem handling any HTTP Method with HTTPS within a proxy.
All the requests with https://
-protocol will be automatically received and sent to port 443
if not indicated otherwise.
Independently if you have a server where you deployed a HAProxy
, NGINX
, Apache Web Server
or that you literally wrote a proxy like this one in JavaScript, only thing you have to do is to literally proxy the requests to the destination server address.
Regarding the encryption, precisely HTTPS ensures that there are no eavesdroppers between the client and the actual target, so the Proxy would act as initial target and then this would transparently intercept the connection.
- Client starts HTTPS session to Proxy
- Proxy intercepts and returns its certificate, signed by a CA trusted by the client.
- Proxy starts HTTPS session to Target
- Target returns its certificate, signed by a CA trusted by the Proxy.
- Proxy streams content, decrypt and re-encrypt with its certificate.
Basically it's a concatenation of two HTTPS sessions, one between the client and the proxy and other between the proxy and the final destination.