Skip to content

Instantly share code, notes, and snippets.

@shiv213
Created September 20, 2018 05:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiv213/263b29c7821adccd501f00d8031afc49 to your computer and use it in GitHub Desktop.
Save shiv213/263b29c7821adccd501f00d8031afc49 to your computer and use it in GitHub Desktop.
Simple Python script to retrieve ngrok tunnel addresses
import requests
r = requests.get('http://localhost:4040/api/tunnels')
datajson = r.json()
msg = ""
for i in datajson['tunnels']:
msg = msg + i['public_url'] + '\n'
print(msg)
@ynx0
Copy link

ynx0 commented Sep 20, 2018

y tho

@shiv213
Copy link
Author

shiv213 commented Aug 25, 2019

y tho

minecraft :)

@RobertNissan
Copy link

bro, y como se hace para que en el mismo script se ejecute ngrok y luego obtener la URL ?

@ynx0
Copy link

ynx0 commented Feb 3, 2023

Puedes hacer os.system('ngrok http 80 --log=stdout >/dev/null &')

Tambien puedes usar urls = [tunnels['tunnels'][i]['public_url'] for i in range(len(tunnels['tunnels']))]

@RobertNissan
Copy link

RobertNissan commented Feb 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment