View random ngrok URL when run in background

jtebert picture jtebert · Dec 16, 2015 · Viewed 20.1k times · Source

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?

Answer

Abe Petrillo picture Abe Petrillo · Dec 23, 2015

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