Skip to content

Latest commit

 

History

History
 
 

ngrok

Ngrok

Author: Nick Santos

Create public URLs for your local services with ngrok

Requirements

  • bash
  • ngrok
  • GNU core utils (tr, sort) - brew install coreutils

Usage

When you include this extension, Tilt starts an ngrok server on port 4040 with no tunnels open by default.

Every service with a link or port-forward will have a new button labelled 'ngrok'.

Clicking the button will create a new tunnel. You can see all the currently open tunnels at http://localhost:4040/.

Flags

--auth=my-user:my-password: Adds a basic auth prompt to all tunnels.

Examples

Default behavior:

v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions')
v1alpha1.extension(name='ngrok:config', repo_name='default', repo_path='ngrok')

With auth:

v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions')
v1alpha1.extension(
  name='ngrok:config', 
  repo_name='default', 
  repo_path='ngrok', 
  args=['--auth=my-user:my-password'])

With auth from a file:

password = str(read_file(os.path.join(os.getenv('HOME'), '.ngrok-password'))).strip()
v1alpha1.extension_repo(name='default', url='https://github.com/tilt-dev/tilt-extensions')
v1alpha1.extension(
  name='ngrok:config', 
  repo_name='default', 
  repo_path='ngrok', 
  args=['--auth=my-user:%s' % password])

Future Work

Allowlist/blocklist

Only create the ngrok option for certain services / disallow it from other services.

Custom port

ngrok currently always starts on port 4040