Skip to content

Instantly share code, notes, and snippets.

@Lee-W
Last active June 9, 2017 09:53
Show Gist options
  • Save Lee-W/07045c9cad45c25ea7728b02e2b52b8e to your computer and use it in GitHub Desktop.
Save Lee-W/07045c9cad45c25ea7728b02e2b52b8e to your computer and use it in GitHub Desktop.
import json
try:
from urllib.request import urlopen
except ImportError:
from urllib import urlopen
req = urlopen('http://localhost:4040/api/tunnels')
ngrok_tunnels = json.loads(req.read().decode())
ngrok_public_url = ngrok_tunnels['tunnels'][0]['public_url']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment