0
defmodule Elixirrest.MixProject do
  use Mix.Project

  def project do
    [
      app: :elixirrest,
      version: "0.1.0",
      elixir: "~> 1.6",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger]
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      {:maru, "~> 0.13"}
    ]
  end
end

When I run

mix do deps.get, compile

I receive:

Could not find Hex, which is needed to build dependency :maru
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] y

** (Mix) httpc request failed with: {:could_no_establish_ssh_tunnel, {'HTTP/1.1', 407, 'Proxy Authorization Required'}}

Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.

Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
Rafael Augusto
  • 777
  • 5
  • 14
  • 28

1 Answers1

-1

You should be able to export the proxy settings through environment variables.

https://github.com/elixir-lang/elixir/blob/ab302d23e4b632486645cdf0fcc392e66b7abb99/lib/mix/lib/mix/utils.ex#L609-L614

  defp proxy_env do
    http_proxy = System.get_env("HTTP_PROXY") || System.get_env("http_proxy")
    https_proxy = System.get_env("HTTPS_PROXY") || System.get_env("https_proxy")
    no_proxy = no_proxy_env() |> no_proxy_list()

    {proxy_setup(:http, http_proxy, no_proxy), proxy_setup(:https, https_proxy, no_proxy)}
  end
Mike Buhot
  • 4,790
  • 20
  • 31