Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there any way to get the Ngrok tunnel's URL list from http://localhost:4040 in C#? Can someone point me in a direction or post an example?

What I have tried:

I found some ngrok API's but nothing special so far.
Posted
Updated 4-Oct-22 9:27am
v3
Comments
Garth J Lancaster 9-Jun-20 22:54pm    
"but nothing special so far." really - that is a pretty useless comment, it tells us nothing about what difficulties you had - as Richard pointed out, it's in the documentation - in particular, you can issue a GET for /api/tunnels to your ngrok instance, it it would respond with the JSON below .. it's a pretty simple task to whip up a C# HttpRequest to handle this ...
{  "tunnels": [      {          "name": "command_line",          "uri": "/api/tunnels/command_line",          "public_url": "https://d95211d2.ngrok.io",          "proto": "https",          "config": {              "addr": "localhost:80",              "inspect": true,          },          "metrics": {              "conns": {                  "count": 0,                  "gauge": 0,                  "rate1": 0,                  "rate5": 0,                  "rate15": 0,                  "p50": 0,                  "p90": 0,                  "p95": 0,                  "p99": 0              },              "http": {                  "count": 0,                  "rate1": 0,                  "rate5": 0,                  "rate15": 0,                  "p50": 0,                  "p90": 0,                  "p95": 0,                  "p99": 0              }          }      },      ...  ],  "uri": "/api/tunnels"}
CyberSecII 21-Sep-20 3:20am    
You did not understand the question but it seems that you have given a solution? how did that happen? Of course, you understand exactly what he means its not so hard.

 
Share this answer
 
Example for port 19628

ngrok.exe http --host-header="localhost:19628" 19628
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900