HTTPoison proxy option not working

I have this curl request

curl -x "" -k ""

The curl request is going through the proxy server and I’m getting at each hit a new ip address (which is the expected behavior).

But when I try with HTTPoison it’s not working as expected.

I tried these codes

HTTPoison.get!("", [], [proxy: {""}])

HTTPoison.get!("", [], [{:proxy, ""}])

What am I doing wrong ?

The proxy option expects either a binary or a two-element tuple of {host, port}, so that first one is not going to work.

As for the second one, the URL doesn’t have a port specified like the one in the curl command does. Maybe that’s the problem?

It would be useful to get more detail on “not working as expected” - what happens (error message, stack trace, etc) when you attempt those HTTPoison calls? I don’t have a proxy server handy to test with, so I can’t see what you’re seeing.

Thank you for your reply and the clear explanation.

I’ll try to tweak the code a bit more based on what you said.