httpoison
httpoison copied to clipboard
checkout_failure when using httpoison with proxy
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
Also experiencing this issue
So there were a few things I had to do to fix it:
- Make sure to set the hackney options for using a socks5 proxy
- 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})
@edgurgel I think this issue can be closed because @CJPoll found the reason.