You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think HTTPoison.get!("https://www.httpbin.org/ip", [], [proxy: "http://proxy-server.com:8001"]) or HTTPoison.get!("http://www.httpbin.org/ip", [], [{:proxy, {"proxy-server.com", 8001}}]) should work.
:proxy - a proxy to be used for the request; it can be a regular url or a {Host, Port} tuple, or a {:socks5, ProxyHost, ProxyPort} tuple
So the issue with the first form is that you're giving it a tuple without splitting up the host / port part. The second isn't working because you haven't specified a port and HTTP defaults to port 80, not the port 8001 that you've told curl to use.
I have this curl request
curl -x "http://proxy-server.com:8001" -k "https://httpbin.org/ip"
The curl request is actually going through the proxy server and I'm getting at each hit a new ip address.
But when I try with HTTPoison it's not working as expected.
I tried these codes
HTTPoison.get!("https://www.httpbin.org/ip", [], [proxy: {"http://proxy-server.com"}])
HTTPoison.get!("https://www.httpbin.org/ip", [], [{:proxy, "http://proxy-server.com"}])
What am I doing wrong ?
The text was updated successfully, but these errors were encountered: