I'm having a problem authenticating on Crawlera service using HTTPoison.
The crawlera's API documentation says I only need the API Token.
i.e. curl -vx proxy.crawlera.com:8010 -U <API key>: http://httpbin.org/ip
So, I'm having problems setting the authentication options on HTTPoison settings.
I'm trying this 3 options:
HTTPoison.get("url", header, hackney: [:insecure], proxy: 'proxy.crawlera.com:8010', proxy_auth: 'api-token')
Error -> (FunctionClauseError) no function clause matching in :hackney.do_connect/7
HTTPoison.get("url", header, hackney: [:insecure], proxy: 'proxy.crawlera.com:8010', proxy_auth: {'api-token',''})
Error -> (ArgumentError) argument error :erlang.bit_size([])
HTTPoison.get("url", header, hackney: [:insecure], proxy: 'api-token:@proxy.crawlera.com:8010')
Error -> {"X-Crawlera-Error", "bad_proxy_auth"}
If someone knows how to set correctly the parameters I'll appreciate the help.
proxy
argument should be a tuple of the host and port.proxy_auth
.The following should work:
proxy: {"proxy.crawlera.com", 8010}, proxy_auth: {"api-token", ""}