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

checkout_failure when using httpoison with proxy #451

Open
mjaow opened this issue Nov 11, 2021 · 3 comments
Open

checkout_failure when using httpoison with proxy #451

mjaow opened this issue Nov 11, 2021 · 3 comments

Comments

@mjaow
Copy link

mjaow commented Nov 11, 2021

traffic went through proxy , and failed with error checkout_failure. Does anyone know this issue?

httpoison version 1.8 and hackney version 1.17.4. with default options + proxy setting + cacert setting for httpoison

@CJPoll
Copy link

CJPoll commented Dec 12, 2021

Also experiencing this issue

@CJPoll
Copy link

CJPoll commented Dec 12, 2021

So there were a few things I had to do to fix it:

  1. Make sure to set the hackney options for using a socks5 proxy
  2. Not directly related to the proxy issue, but I had to change my proxy URL from a binary (Elixir String) to a charlist.

I set the hackney options by implementing process_request_options, which receives any connection options passed to the request and transforms them in whatever way you want. In my case, this did the trick:

# host needs to be a charlist, not a binary/string
options
|> Keyword.put(:proxy, {:socks5, host, port})

@Hentioe
Copy link

Hentioe commented Jun 8, 2022

@edgurgel I think this issue can be closed because @CJPoll found the reason.

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

No branches or pull requests

3 participants