CommunityToolkit.Aspire.Hosting.Ngrok 9.1.1-beta.138

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.Hosting.Ngrok.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CommunityToolkit.Aspire.Hosting.Ngrok --version 9.1.1-beta.138                
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Ngrok -Version 9.1.1-beta.138                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Ngrok" Version="9.1.1-beta.138" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CommunityToolkit.Aspire.Hosting.Ngrok --version 9.1.1-beta.138                
#r "nuget: CommunityToolkit.Aspire.Hosting.Ngrok, 9.1.1-beta.138"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CommunityToolkit.Aspire.Hosting.Ngrok as a Cake Addin
#addin nuget:?package=CommunityToolkit.Aspire.Hosting.Ngrok&version=9.1.1-beta.138&prerelease

// Install CommunityToolkit.Aspire.Hosting.Ngrok as a Cake Tool
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Ngrok&version=9.1.1-beta.138&prerelease                

CommunityToolkit.Aspire.Hosting.Ngrok library

Provides extension methods and resource definitions for a .NET Aspire AppHost to configure a ngrok container.

Getting Started

Install the package

In your AppHost project, install the package using the following command:

dotnet add package CommunityToolkit.Aspire.Hosting.Ngrok

Example usage

Then, in the Program.cs file of app host, add a ngrok resource and add endpoints to be tunneled following methods:

var myService = builder.AddProject<Projects.MyService>();
var otherSevice = builder.AddProject<Projects.OtherService>();

var authToken = builder
    .AddParameter("ngrok-auth-token", "your-ngrok-auth-token", secret: true);

builder.AddNgrok("ngrok", endpointPort: 59600) // omit endpointPort to use random port
    .WithAuthToken(authToken)
    .WithTunnelEndpoint(myService, "http", "<your-ngrok-domain>")
    .WithTunnelEndpoint(otherSevice, "http"); // ngrok will generate a random domain for this service

Querying the ngrok tunneled endpoints

After the ngrok container has started, you can query the ngrok tunneled endpoints using api exposed by the ngrok container:

curl -H "Accept: application/json" -s http://localhost:59600/api/tunnels

This will return a JSON response with the ngrok tunneled endpoints.

{
  "tunnels": [
    {
      "name": "my-http",
      "ID": "5baa78f84cffb31a96cccf5bbe992451",
      "uri": "/api/tunnels/my-http",
      "public_url": "https://<your-ngrok-domain>",
      "proto": "https",
      "config": {
        "addr": "http://host.docker.internal:5165",
        "inspect": true
      },
      // ...
    }, {
      "name": "other-http",
      "ID": "f7f1351d1307e3615ca7de310bf6bb61",
      "uri": "/api/tunnels/other-http",
      "public_url": "https://0849-94-134-176-242.ngrok-free.app",
      "proto": "https",
      "config": {
          "addr": "http://host.docker.internal:3657",
          "inspect": true
      },
      // ...
    }
  ],
  "uri": "/api/tunnels"
}

Additional Information

Feedback & contributing

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.1.1-beta.190 41 2/19/2025
9.1.1-beta.189 32 2/19/2025
9.1.1-beta.188 36 2/19/2025
9.1.1-beta.187 41 2/19/2025
9.1.1-beta.183 44 2/18/2025
9.1.1-beta.182 38 2/18/2025
9.1.1-beta.181 48 2/18/2025
9.1.1-beta.180 38 2/17/2025
9.1.1-beta.178 39 2/17/2025
9.1.1-beta.177 42 2/12/2025
9.1.1-beta.176 41 2/11/2025
9.1.1-beta.175 34 2/11/2025
9.1.1-beta.173 37 2/10/2025
9.1.1-beta.169 39 2/6/2025
9.1.1-beta.168 31 2/5/2025
9.1.1-beta.166 40 2/5/2025
9.1.1-beta.165 31 2/5/2025
9.1.1-beta.164 41 2/3/2025
9.1.1-beta.162 41 2/3/2025
9.1.1-beta.155 33 1/30/2025
9.1.1-beta.154 30 1/30/2025
9.1.1-beta.153 29 1/30/2025
9.1.1-beta.152 11 1/29/2025
9.1.1-beta.150 35 1/29/2025
9.1.1-beta.148 39 1/26/2025
9.1.1-beta.147 30 1/26/2025
9.1.1-beta.146 34 1/23/2025
9.1.1-beta.145 31 1/22/2025
9.1.1-beta.144 29 1/22/2025
9.1.1-beta.142 32 1/22/2025
9.1.1-beta.140 33 1/22/2025
9.1.1-beta.139 33 1/21/2025
9.1.1-beta.138 30 1/20/2025
9.1.1-beta.137 32 1/17/2025
9.1.1-beta.136 34 1/15/2025
9.1.1-beta.135 12 1/15/2025
9.1.1-beta.134 14 1/15/2025