0

I’m using HTTPoison to send HTTP requests through a proxy, but when I change the proxy’s port, HTTPoison doesn’t seem to automatically adapt:

iex(1)> HTTPoison.get! "http://httpbin.org/ip", %{}, [proxy: {:socks5,'127.0.0.1', 9052}]

%HTTPoison.Response{
  body: "{\n  \"origin\": \"156.54.213.67, 156.54.213.67\"\n}\n",

iex(2)> HTTPoison.get! "http://httpbin.org/ip", %{}, [proxy: {:socks5,'127.0.0.1', 3}]   

%HTTPoison.Response{
  body: "{\n  \"origin\": \"156.54.213.67, 156.54.213.67\"\n}\n",

Is there a way to force HTTPoison to use the port that was sent as an argument ?

Adam Millerchip
  • 20,844
  • 5
  • 51
  • 74
stolmen
  • 3
  • 2

1 Answers1

0

From Wikipedia:

The port numbers in the range from 0 to 1023 are the well-known ports or system ports.[2] They are used by system processes that provide widely used types of network services. On Unix-like operating systems, a process must execute with superuser privileges to be able to bind a network socket to an IP address using one of the well-known ports.

What happens if you try a second port of 44555?

7stud
  • 46,922
  • 14
  • 101
  • 127