View Source Ngrok (ngrok v1.1.0)
By including this supervisor in your application, an Ngrok process will be started when your application starts and stopped when your application stops
options
Options
port
(integer
/required
) - The port to tunnel.protocol
(atom
/ default:https
) - The protocol to tunnel. (http
/https
/tcp
/tls
)additional_arguments
([String.t()]
/ default:[]
) - Additional options to pass tongrok
.name
(Supervisor name / default:Ngrok
) - Name of the supervisor in your application.api_url
(url / default:http://localhost:4040/api/tunnels
) - The URL of Ngrok's API (used to retrieve its settings).sleep_between_attempts
(timeout (ms) / default: 200) - The amount of sleep (in ms) to put between attempts to connect to Ngrok
config
Config
config :ngrok,
# The name / path of the Ngrok executable
executable: "ngrok"
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Retrieves the public URL of the Ngrok tunnel
Link to this section Types
@type destination_port() :: pos_integer()
@type protocol() :: :http | :https | :tcp | :tls
@type start_opts() :: [ port: destination_port(), additional_arguments: [String.t()], protocol: protocol(), api_url: String.t(), sleep_between_attempts: timeout(), name: strict_name() ]
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec public_url(name :: strict_name()) :: String.t()
Retrieves the public URL of the Ngrok tunnel
example
Example
Ngrok.public_url # => http://(.*).ngrok.io/
@spec start_link(opts :: start_opts()) :: Supervisor.on_start()