Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for HTTP proxy: replace the HTTP client with reqwest #3424

Merged
merged 12 commits into from
Oct 28, 2024

Conversation

sandhose
Copy link
Member

@sandhose sandhose commented Oct 24, 2024

This replaces the old stack of tower layers with just reqwest. This has many advantages, like:

  • sane defaults in terms of redirects, timeouts, connection pooling
  • HTTP_PROXY support
  • removing a LOT of code we had to use our custom clients with Sentry and OpenTelemetry
  • just a better user-facing API

I also took the opportunity to simplify A LOT mas-oidc-client to only the things we use, instead of making it so generic, which removes a lot of code

The only downside I see, is that it's a lot harder to test fake client requests. wiremock works well, but can't listen for HTTPS traffic.

One important thing to shout about in the changelog, is that we now support proxies, using the following environment variables:

  • http_proxy/HTTP_PROXY for proxying HTTP requests
  • https_proxy/HTTPS_PROXY for proxying HTTPS requests (note that this won't bypass CA verification, so stuff like mitmproxy require trusting an extra CA)
  • all_proxy/ALL_PROXY for both
  • no_proxy/NO_PROXY to add exclusions of hosts/IPs which shouldn't be proxied

It supports both HTTP and SOCKS5 proxies.

Copy link

cloudflare-workers-and-pages bot commented Oct 24, 2024

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2876c75
Status: ✅  Deploy successful!
Preview URL: https://ea54a33d.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-reqwest.matrix-authentication-service-docs.pages.dev

View logs

@sandhose sandhose marked this pull request as ready for review October 25, 2024 16:27
@sandhose sandhose merged commit 908b7d6 into main Oct 28, 2024
17 checks passed
@sandhose sandhose deleted the quenting/reqwest branch October 28, 2024 12:46
@sandhose sandhose added the T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. label Dec 16, 2024
@sandhose sandhose changed the title Replace the HTTP client with reqwest Support for HTTP proxy: replace the HTTP client with reqwest Dec 16, 2024
@sandhose sandhose added T-Enhancement New feature of request and removed T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Enhancement New feature of request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant