| 1194 | } |
| 1195 | |
| 1196 | type ProxyConfig struct { |
| 1197 | // HTTP proxy server to use to connect to the targets. |
| 1198 | ProxyURL URL `yaml:"proxy_url,omitempty" json:"proxy_url,omitempty"` |
| 1199 | // NoProxy contains addresses that should not use a proxy. |
| 1200 | NoProxy string `yaml:"no_proxy,omitempty" json:"no_proxy,omitempty"` |
| 1201 | // ProxyFromEnvironment makes use of net/http ProxyFromEnvironment function |
| 1202 | // to determine proxies. |
| 1203 | ProxyFromEnvironment bool `yaml:"proxy_from_environment,omitempty" json:"proxy_from_environment,omitempty"` |
| 1204 | // ProxyConnectHeader optionally specifies headers to send to |
| 1205 | // proxies during CONNECT requests. Assume that at least _some_ of |
| 1206 | // these headers are going to contain secrets and use Secret as the |
| 1207 | // value type instead of string. |
| 1208 | ProxyConnectHeader Header `yaml:"proxy_connect_header,omitempty" json:"proxy_connect_header,omitempty"` |
| 1209 | |
| 1210 | proxyFunc func(*http.Request) (*url.URL, error) |
| 1211 | } |
| 1212 | |
| 1213 | // UnmarshalYAML implements the yaml.Unmarshaler interface. |
| 1214 | func (c *ProxyConfig) Validate() error { |
nothing calls this directly
no outgoing calls
no test coverage detected