rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
6.01k stars 282 forks source link

[Feature Request] HTTP proxy: relay HTTP request to upstream proxy without CONNECT #5789

Open nicerloop opened 1 year ago

nicerloop commented 1 year ago

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

nicerloop commented 1 year ago

https://github.com/rancher-sandbox/rancher-desktop/issues/4603