(Edit: I cleared this issue by using HTTPoison's get! function.
HTTPoison.start
HTTPoison.get!("httpbin.org/get", [], [{:proxy, {"proxy.mydomain.com", 8080}}])
I'm a newbie for using elixir. I tried the sample app on httpotion as the first step.
iex> response = HTTPotion.get "httpbin.org/get"
However, it couldn't reach to the site behind the proxy.
iex(1)> res = HTTPotion.get "httpbin.org/get"
** (HTTPotion.HTTPError) nxdomain
(httpotion) lib/httpotion.ex:195: HTTPotion.handle_response/1
Without proxy, it successfully works like this;
iex(1)> res = HTTPotion.get "httpbin.org/get"
%HTTPotion.Response{body: "{\n \"args\": {}, \n \"headers\": {\n \"Content-Length\": \"0\", \n \"Host\": \"httpbin.org\"\n }, \n \"origin\": \"191.238.84.51\", \n \"url\": \"http://httpbin.org/get\"\n}\n",
headers: ["Access-Control-Allow-Credentials": "true",...
I tried to set proxy parameters by reading ibrowse which httpotion depends on, like;
req = HTTPotion.get("httpbin.org/get", [{:proxy_host, "proxy.mydomain.com"}, {:proxy_port, 8080}])
But the result is same.
How can I set the proxy parameters for httpotion? Or are there any replacement library on elixir for HTTP access which can handle proxies?
My environment is Ubuntu 14.04.2 and environment variables (http_proxy, https_proxy, HTTP_PROXY and HTTPS_PROXY) are set correctly.