Skip to content

Instantly share code, notes, and snippets.

@paperbenni
Forked from Dalimil/ngrok_url.sh
Created April 6, 2018 14:28
Show Gist options
  • Save paperbenni/d36b85f3c61c17386cb3c515306f5024 to your computer and use it in GitHub Desktop.
Save paperbenni/d36b85f3c61c17386cb3c515306f5024 to your computer and use it in GitHub Desktop.
Get ngrok URL from command line
# ngrok should be running
# replace http with https at the end if needed
# based on: https://gist.github.com/rjz/af40158c529d7c407420fc0de490758b
echo $(curl -s localhost:4040/inspect/http | grep -oP 'window.common[^;]+' | sed 's/^[^\(]*("//' | sed 's/")\s*$//' | sed 's/\\"/"/g') | jq -r ".Session.Tunnels | values | map(.URL) | .[]" | grep "^tcp://"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment