View random ngrok URL when run in background

前端 未结 12 1709
旧时难觅i
旧时难觅i 2021-02-02 08:16

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:

12条回答
  •  -上瘾入骨i
    2021-02-02 08:41

    If you love PowerShell, here it is in variables.

    $ngrokOutput = ConvertFrom-Json (Invoke-WebRequest -Uri http://localhost:4040/api/tunnels).Content
    $httpsUrl = $ngrokOutput.tunnels.public_url[0]
    $httpUrl = $ngrokOutput.tunnels.public_url[1]
    

提交回复
热议问题