16 lines
437 B
Go
16 lines
437 B
Go
package proxy
|
|
|
|
import (
|
|
"net/http"
|
|
"net/url"
|
|
)
|
|
|
|
// DirectTransport returns a transport that never uses HTTP_PROXY/HTTPS_PROXY.
|
|
// Upstream Telemt hosts are usually private or loopback; env proxies break that and
|
|
// httptest in CI when runners set HTTP_PROXY.
|
|
func DirectTransport() *http.Transport {
|
|
t := http.DefaultTransport.(*http.Transport).Clone()
|
|
t.Proxy = func(*http.Request) (*url.URL, error) { return nil, nil }
|
|
return t
|
|
}
|