Skip to content

Commit

Permalink
feat (native): update transport proxy docs (#11899)
Browse files Browse the repository at this point in the history
* feat: add proxy support overview

* added socks proxy code snippet + cleanup

* chore: add highlighting for technical terms
  • Loading branch information
JoshuaMoelans authored Nov 25, 2024
1 parent 80e4a25 commit d7679b2
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions docs/platforms/native/configuration/transports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,31 @@ The transport is invoked in the same thread as the call to
`sentry_capture_event`. Consider to offload network communication to a
background thread or thread pool to avoid blocking execution.
## Using an HTTP Proxy
## Using a Proxy
The Native SDK allows the configuration of an HTTP proxy through which requests can be tunneled to our backend. This proxy must allow `CONNECT` requests to establish a proxy connection. 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 via the following option interface:
```c
sentry_options_t *options = sentry_options_new();
sentry_options_set_http_proxy(options, "http://my.proxy:10010");
sentry_options_set_proxy(options, "http://my.proxy:8080");
sentry_init(options);
/* ... */
```
The same function can also be used for the `SOCKS5` proxy:
```c
sentry_options_t *options = sentry_options_new();
sentry_options_set_proxy(options, "socks5://my.proxy:1080");
sentry_init(options);

/* ... */
```
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.
| Platform | http-proxy | socks-proxy |
|----------|-----------------------------------------------------|------------------------------------------------------|
| Windows | Internal: fallback <br /> Crashpad: fallback | N/A |
| Linux | Internal: fallback <br /> Crashpad: fallback | Internal: no fallback <br /> Crashpad: no fallback |
| macOS | Internal: no fallback <br /> Crashpad: no fallback | Internal: no fallback <br /> Crashpad: fallback |

0 comments on commit d7679b2

Please sign in to comment.