Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Latest commit

 

History

History
149 lines (119 loc) · 4.58 KB

README.md

File metadata and controls

149 lines (119 loc) · 4.58 KB

No longer maintained

Contributors Forks Stargazers Issues MIT License Coverage

NgrokSharp

A dotnet library for ngrok.
Explore the docs »

Report Bug · Request Feature

Table of Contents

  1. Getting Started
  2. Usage
  3. Roadmap
  4. Contributing
  5. License
  6. Acknowledgements

About The Project

Features

  • Easy to use API
  • Downloads the correct Ngrok version for your platform
  • Supports different logging providers by implementing Microsoft.Extensions.Logging

Getting Started

Installation

Install via nuget.org

Usage

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

NgrokGUI

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

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.

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

Thanks to these