问题
I'm using ngrok
's free level service, and after starting ngrok
, would like to find out the http and/or https URL it assigned to the tunnel.
I was hoping the ngrok log would display the URL, but it does not.
I'm aware that I could probably set this URL with the paid version but would prefer not to upgrade if possible.
Is this functionality intentionally thwarted for security reasons?
Programmatically determining the URL would enable me to automate the using of the tunnel, and, more importantly, therefore, the termination of it, so that I don't need to worry about forgetting to terminate it manually.
Although the ngrok
output appears on the console, I am unable to see it in stdout
or stderr
; or at least, if I try piping them to tee
, I don't get any output at all. I would have expected to see ANSI escape sequences for the enhanced console output, but don't. How is it sending output to the terminal? By running strings ngrok | sort -u | less
, I see that ngrok is a go
application. What is it using if not stdout
?
来源:https://stackoverflow.com/questions/53921092/how-to-get-programmatically-get-ngroks-urls