@@ -340,6 +340,72 @@ namespace Aws
340340 String BasicAuthPassword;
341341 };
342342
343+ /* *
344+ * Configuration to enable or disable environment variable based proxy lookup.
345+ */
346+ enum class ProxyEnvVarType
347+ {
348+ /* *
349+ * Default.
350+ * Disable reading from environment variable for proxy.
351+ */
352+ Disabled = AWS_HPEV_DISABLE,
353+ /* *
354+ * Enable get proxy URL from environment variable, when the manual proxy options of connection manager
355+ * is not set. env HTTPS_PROXY/https_proxy will be checked when the main connection use tls. env
356+ * HTTP_PROXY/http_proxy will be checked when the main connection NOT use tls. env NO_PROXY/no_proxy
357+ * will be checked to bypass proxy if the host match the pattern. Check `aws_http_host_matches_no_proxy`
358+ * for detail. This function can also be used with a direct no_proxy parameter. The lower case version
359+ * has precedence.
360+ */
361+ Enabled = AWS_HPEV_ENABLE,
362+ };
363+
364+ /* *
365+ * Configuration structure that holds all proxy-related http connection options
366+ */
367+ class AWS_CRT_CPP_API ProxyEnvVarOptions
368+ {
369+ public:
370+ ProxyEnvVarOptions ();
371+ ProxyEnvVarOptions (const ProxyEnvVarOptions &rhs) = default ;
372+ ProxyEnvVarOptions (ProxyEnvVarOptions &&rhs) = default ;
373+
374+ ProxyEnvVarOptions &operator =(const ProxyEnvVarOptions &rhs) = default ;
375+ ProxyEnvVarOptions &operator =(ProxyEnvVarOptions &&rhs) = default ;
376+
377+ ~ProxyEnvVarOptions () = default ;
378+
379+ /* *
380+ * Intended for internal use only. Initializes the C proxy configuration structure,
381+ * aws_http_proxy_options, from an HttpClientConnectionProxyOptions instance.
382+ *
383+ * @param raw_options - output parameter containing low level proxy options to be passed to the C
384+ * interface
385+ *
386+ */
387+ void InitializeRawProxyOptions (struct proxy_env_var_settings &raw_options) const ;
388+
389+ /* *
390+ * Enables or disables env var lookup for proxy variables.
391+ */
392+ ProxyEnvVarType proxyEnvVarType;
393+
394+ /* *
395+ * Optional.
396+ * If not set:
397+ * If tls options are provided (for the main connection) use tunnel proxy type
398+ * If tls options are not provided (for the main connection) use forward proxy type
399+ */
400+ AwsHttpProxyConnectionType connectionType;
401+
402+ /* *
403+ * Sets the TLS options for the connection to the proxy.
404+ * Optional.
405+ */
406+ Optional<Io::TlsConnectionOptions> TlsOptions;
407+ };
408+
343409 /* *
344410 * Configuration structure holding all options relating to http connection establishment
345411 */
0 commit comments