sanitizeOptionsWithDefaults sets the default values for ProxyOptions.
(opt ClientConfig)
| 150 | |
| 151 | // sanitizeOptionsWithDefaults sets the default values for ProxyOptions. |
| 152 | func sanitizeOptionsWithDefaults(opt ClientConfig) (ClientConfig, error) { |
| 153 | if opt.MaxIncomingStreams == 0 { |
| 154 | opt.MaxIncomingStreams = defaultMaxIncomingStreams |
| 155 | } |
| 156 | if opt.MaxIdleTimeout == 0 { |
| 157 | opt.MaxIdleTimeout = defaultMaxIdleTimeout |
| 158 | } |
| 159 | if opt.ConnectTimeout == 0 { |
| 160 | opt.ConnectTimeout = defaultConnectTimeout |
| 161 | } |
| 162 | |
| 163 | return opt, nil |
| 164 | } |
| 165 | |
| 166 | // NewClient provides a method that returns a new Client object, creating |
| 167 | // a new http3.RoundTripper object dedicated to be used with the provided proxy address. |