// NewProxy creates a new instance of the Proxy
func NewProxy(config Config) *Proxy {
proxy := &Proxy{
Config: config,
transport: &http.Transport{
// This forces http.Transport to not upgrade requests to HTTP/2
// TODO: Remove when HTTP/2 can be supported
TLSNextProto: make(map[string]func(string, *tls.Conn) http.RoundTripper),
Proxy: http.ProxyFromEnvironment,
...
The Proxy: http.ProxyFromEnvironment is what affects me specifically. I am using an upstream proxy, and having to os.Setenv... to make it work is very inelegant:
Being able to pass this in, perhaps via the Config would be amazing. I would be happy to make a PR, please suggest if can be added to Config (maybe simple/non-breaking) or should be done some other way.
gomitmproxy.NewProxy
starts out as follows:The
Proxy: http.ProxyFromEnvironment
is what affects me specifically. I am using an upstream proxy, and having toos.Setenv...
to make it work is very inelegant:Being able to pass this in, perhaps via the
Config
would be amazing. I would be happy to make a PR, please suggest if can be added toConfig
(maybe simple/non-breaking) or should be done some other way.Thank you.