My corporate proxy does not allow using CONNECT to establish connections to port 80, but requires cleartext HTTP proxy requests. The currently used moproxy does not handle such case.
I have used, in a similar context, redsocks to achieve such redirections from a Docker for Windows environment, with two chains: one for port 80 to the http_relay module, the other for the rest to the http_connect module.
Problem Description
My corporate proxy does not allow using CONNECT to establish connections to port 80, but requires cleartext HTTP proxy requests. The currently used moproxy does not handle such case.
Proposed Solution
Connections to port 80 can be checked for HTTP correctness, and be proxied as GET/POST/PUT/xxx requests to the upstream HTTP proxy. See https://github.com/darkk/redsocks/blob/master/http-relay.c for inspiration.
Additional Information
I have used, in a similar context, redsocks to achieve such redirections from a Docker for Windows environment, with two chains: one for port 80 to the http_relay module, the other for the rest to the http_connect module.
See:
https://github.com/darkk/redsocks https://github.com/k-labs/docker-forgetproxy https://github.com/ncarlier/dockerfiles/tree/master/redsocks
Already open upstream as https://github.com/sorz/moproxy/issues/23