Skip to content

Commit

Permalink
Merge pull request #17 from joshuafleck/expose_https_urls
Browse files Browse the repository at this point in the history
Allow for HTTPS protocol to be specified
  • Loading branch information
Joshua Fleck authored Dec 2, 2018
2 parents 4688d3c + 30afd5e commit 481c7b5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ of the following in your `config/config.exs` file:
config :ex_ngrok,
# The name of the Ngrok executable
executable: "ngrok",
# The type of tunnel (http, tcp, or tls)
# The type of tunnel (http, https, tcp, or tls)
protocol: "http",
# The port to which Ngrok will forward requests
port: "4000",
Expand Down
12 changes: 11 additions & 1 deletion lib/executable.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@ defmodule Ngrok.Executable do
defp ngrok do
arguments = [
Application.get_env(:ex_ngrok, :executable),
Application.get_env(:ex_ngrok, :protocol),
protocol(),
Application.get_env(:ex_ngrok, :port),
Application.get_env(:ex_ngrok, :options),
]
Enum.join(arguments, " ")
end

@spec protocol :: String.t
defp protocol do
case Application.get_env(:ex_ngrok, :protocol) do
"https" ->
"http"
protocol ->
protocol
end
end
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Ngrok.Mixfile do

def project do
[app: :ex_ngrok,
version: "0.3.3",
version: "0.3.4",
elixir: "~> 1.7",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
Expand Down

0 comments on commit 481c7b5

Please sign in to comment.