A dotnet library for ngrok.
Explore the docs »
Report Bug
·
Request Feature
- Easy to use API
- Downloads the correct Ngrok version for your platform
- Supports different logging providers by implementing Microsoft.Extensions.Logging
Install via nuget.org
Code example
static async Task Main(string[] args)
{
INgrokManager _ngrokManager;
_ngrokManager = new NgrokManager();
await _ngrokManager.DownloadAndUnzipNgrokAsync();
// Insert your token, if you have one.
//await _ngrokManager.RegisterAuthTokenAsync("Your token");
_ngrokManager.StartNgrok();
var tunnel = new StartTunnelDTO
{
name = "reverse proxy",
proto = "http",
addr = "8080"
};
var httpResponseMessage = await _ngrokManager.StartTunnelAsync(tunnel);
if ((int)httpResponseMessage.StatusCode == 201)
{
var tunnelDetail =
JsonSerializer.Deserialize<TunnelDetailDTO>(
await httpResponseMessage.Content.ReadAsStringAsync());
Console.WriteLine(tunnelDetail.PublicUrl);
}
}
Projects using NgrokSharp
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. But first please read this.
Distributed under the MIT License. See LICENSE
for more information.
Thanks to these