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

HTTP client options #467

Open
danschultzer opened this issue Feb 6, 2023 · 2 comments
Open

HTTP client options #467

danschultzer opened this issue Feb 6, 2023 · 2 comments
Assignees

Comments

@danschultzer
Copy link
Contributor

danschultzer commented Feb 6, 2023

I've experienced issues with honeybadger not working in a IPv6 only network. This is due to a long running issue in hackney of how IP addresses are resolved: benoitc/hackney#206 (in particular this logic).

Looking at how honeybadger deals with HTTP it would be good to:

  1. Allow options to be passed to hackney (this won't solve my particular issue though edit: should work)
  2. Allow option to chose HTTP client
    a. Switch to a flexible library like Tesla
    b. Add an abstraction in honeybadger (this is how I handle it in https://github.com/pow-auth/assent/tree/main/lib/assent to support built-in httpc by default)

A third option, which is about solving the IPv6 issue, is to switch to something other than hackney since upstream fix seems unlikely to happen anytime soon. I solved my issue by switching to Finch and pass in conn_opts: https://github.com/danschultzer/honeybadger-elixir/commit/14bdbe21f6ea754c335478ccb82bb6fa312993a7

@sorentwo sorentwo self-assigned this Feb 6, 2023
@sorentwo
Copy link
Collaborator

sorentwo commented Feb 6, 2023

@danschultzer Thanks for opening this issue; it's something I've thought about a lot recently. An adapter that uses httpc by default, with an easy switch to finch, is perfect.

@joshuap I'll take this one.

@danschultzer
Copy link
Contributor Author

Sounds great @sorentwo, thanks for looking at this!

I did make a quick PR in #468 to pass hackney opts which solves part of the issue. But it would be nice to just pass in an adapter to deal with edge cases and have more control over the connection egress.

Just a warning on :httpc that the cert check has to be handled explicitly (not built-in 😞). But apart from that and no HTTP/2 support, it works fine, and the benefit is that it helps limit the dependency graph size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants