diff --git a/docs/platforms/native/configuration/transports.mdx b/docs/platforms/native/configuration/transports.mdx index b82f576170809..4b43f5597dd28 100644 --- a/docs/platforms/native/configuration/transports.mdx +++ b/docs/platforms/native/configuration/transports.mdx @@ -51,7 +51,7 @@ background thread or thread pool to avoid blocking execution. ## Using a Proxy -The Native SDK allows the configuration of an `HTTP` (`CONNECT`) or `SOCKS5` proxy through which requests can be tunneled to our backend. It can be configured via the following option interface: +The Native SDK allows the configuration of an `HTTP` (`CONNECT`) or `SOCKS5` proxy through which requests can be tunneled to our backend. It can be configured manually via the following option interface: ```c sentry_options_t *options = sentry_options_new(); @@ -69,11 +69,24 @@ sentry_init(options); /* ... */ ``` +You can also enable reading the `https_proxy`/`http_proxy` environment variable by setting the following option: +```c +sentry_options_t *options = sentry_options_new(); +sentry_options_set_read_proxy_from_environment(options, true); +sentry_init(options); + +/* ... */ +``` +Once this is set to true, any manually set proxy value will be ignored if a value exists in either the `https_proxy` or `http_proxy` environment variables. These get read in this order, so `https_proxy` has precedence over `http_proxy`. -We support `HTTP` proxies on all platforms, and `SOCKS5` proxies on Linux and macOS. Depending on the platform, the transport provides a fallback in case the proxy is not reachabled. The following table shows the expected behaviour. +### Proxy behavior + +We support `HTTP` proxies on all platforms, and `SOCKS5` proxies on Linux and macOS. Depending on the platform, the default transport provides a fallback in case the proxy is not reachabled. The following table shows the expected behaviour. | Platform | http-proxy | socks-proxy | |----------|-----------------------------------------------------|------------------------------------------------------| | Windows | Internal: fallback
Crashpad: fallback | N/A | | Linux | Internal: fallback
Crashpad: fallback | Internal: no fallback
Crashpad: no fallback | | macOS | Internal: no fallback
Crashpad: no fallback | Internal: no fallback
Crashpad: fallback | + +On Windows, `https` proxy servers are not supported by the default transport (WinHTTP).