When I start an ngrok client with ./ngrok tcp 22
it runs in the foreground and I can see the randoming generated forwarding URL, such as tcp://0.tcp.ngrok.io:12345 -> localhost:22
.
If I run in it the background with ./ngrok tcp &
, I can't find any way to see the forwarding URL. How can I run ngrok in the background and still see the URL?
On your server, open the Administration area of Digital Assistant, by navigating to http://localhost/Admin/. Go to Settings → Global and under Base URL enter the ServerPublicURL determined by ngrok.
There are a couple of ways.
You can either:
1) Visit localhost:4040/status
in your browser to see a bunch of information, or
2) Use curl to hit the API: localhost:4040/api/tunnels
This little Python (2.7) script will call the ngrok API and print the current URL's:
import json import os os.system("curl http://localhost:4040/api/tunnels > tunnels.json") with open('tunnels.json') as data_file: datajson = json.load(data_file) msg = "ngrok URL's: \n' for i in datajson['tunnels']: msg = msg + i['public_url'] +'\n' print (msg)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With