CommunityToolkit.Aspire.Hosting.Ngrok 9.3.1-beta.244

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.Hosting.Ngrok.
There is a newer version of this package available.
See the version list below for details.
dotnet add package CommunityToolkit.Aspire.Hosting.Ngrok --version 9.3.1-beta.244
                    
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Ngrok -Version 9.3.1-beta.244
                    
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.3.1-beta.244" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Ngrok" Version="9.3.1-beta.244" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Ngrok" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommunityToolkit.Aspire.Hosting.Ngrok --version 9.3.1-beta.244
                    
#r "nuget: CommunityToolkit.Aspire.Hosting.Ngrok, 9.3.1-beta.244"
                    
#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.
#addin nuget:?package=CommunityToolkit.Aspire.Hosting.Ngrok&version=9.3.1-beta.244&prerelease
                    
Install CommunityToolkit.Aspire.Hosting.Ngrok as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Ngrok&version=9.3.1-beta.244&prerelease
                    
Install CommunityToolkit.Aspire.Hosting.Ngrok as a Cake Tool

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.4.1-beta.270 55 2 days ago
9.4.0 47 2 days ago
9.4.0-beta.269 43 3 days ago
9.4.0-beta.268 35 3 days ago
9.3.1-beta.267 40 3 days ago
9.3.1-beta.266 40 3 days ago
9.3.1-beta.265 144 8 days ago
9.3.1-beta.264 146 8 days ago
9.3.1-beta.263 143 8 days ago
9.3.1-beta.262 146 8 days ago
9.3.1-beta.260 115 12 days ago
9.3.1-beta.259 114 15 days ago
9.3.1-beta.258 118 15 days ago
9.3.1-beta.257 119 15 days ago
9.3.1-beta.256 112 15 days ago
9.3.1-beta.255 113 15 days ago
9.3.1-beta.254 111 15 days ago
9.3.1-beta.253 115 22 days ago
9.3.1-beta.252 89 a month ago
9.3.1-beta.250 91 a month ago
9.3.1-beta.249 88 a month ago
9.3.1-beta.248 92 a month ago
9.3.1-beta.247 92 a month ago
9.3.1-beta.244 437 a month ago
9.3.1-beta.242 436 a month ago
9.3.1-beta.241 110 a month ago
9.3.0 402 a month ago
9.3.0-beta.239 106 a month ago
9.2.2-beta.237 116 a month ago
9.2.2-beta.236 76 a month ago
9.2.2-beta.230 109 a month ago
9.2.2-beta.229 108 a month ago
9.2.2-beta.228 123 a month ago
9.2.2-beta.227 119 a month ago
9.2.2-beta.226 121 a month ago
9.2.2-beta.225 112 a month ago
9.2.2-beta.224 116 a month ago
9.2.2-beta.223 124 a month ago
9.2.2-beta.222 124 a month ago
9.2.2-beta.220 117 a month ago
9.2.2-beta.218 119 a month ago
9.2.2-beta.217 158 2 months ago
9.2.2-beta.216 163 2 months ago
9.2.2-beta.215 160 2 months ago
9.2.2-beta.214 161 2 months ago
9.2.2-beta.213 151 2 months ago
9.2.2-beta.212 155 2 months ago
9.2.2-beta.211 157 2 months ago
9.2.2-beta.210 158 2 months ago
9.2.2-beta.208 60 2 months ago
9.2.1 111 2 months ago
9.2.1-beta.207 79 2 months ago
9.2.1-beta.206 53 2 months ago
9.2.1-beta.205 55 2 months ago
9.2.1-beta.204 52 2 months ago
9.2.1-beta.203 50 2 months ago
9.2.0 105 2 months ago
9.2.0-beta.202 45 2 months ago
9.2.0-beta.201 54 2 months ago
9.2.0-beta.199 52 2 months ago
9.2.0-beta.198 46 2 months ago
9.1.1-beta.197 55 2 months ago
9.1.1-beta.196 58 2 months ago
9.1.1-beta.195 50 2 months ago
9.1.1-beta.194 54 2 months ago
9.1.1-beta.193 57 2 months ago
9.1.1-beta.192 57 2 months ago
9.1.1-beta.191 99 2 months ago
9.1.1-beta.190 61 2 months ago
9.1.1-beta.189 51 2 months ago
9.1.1-beta.188 58 2 months ago
9.1.1-beta.187 64 2 months ago
9.1.1-beta.183 64 2 months ago
9.1.1-beta.182 59 2 months ago
9.1.1-beta.181 74 2 months ago
9.1.1-beta.180 59 2 months ago
9.1.1-beta.178 57 2 months ago
9.1.1-beta.177 71 2 months ago
9.1.1-beta.176 67 2 months ago
9.1.1-beta.175 58 2 months ago
9.1.1-beta.173 61 2 months ago
9.1.1-beta.169 58 3 months ago
9.1.1-beta.168 50 3 months ago
9.1.1-beta.166 55 3 months ago
9.1.1-beta.165 46 3 months ago
9.1.1-beta.164 57 3 months ago
9.1.1-beta.162 56 3 months ago
9.1.1-beta.155 54 3 months ago
9.1.1-beta.154 49 3 months ago
9.1.1-beta.153 48 3 months ago
9.1.1-beta.152 44 3 months ago
9.1.1-beta.150 55 3 months ago
9.1.1-beta.148 58 3 months ago
9.1.1-beta.147 49 3 months ago
9.1.1-beta.146 53 3 months ago
9.1.1-beta.145 47 3 months ago
9.1.1-beta.144 48 3 months ago
9.1.1-beta.142 51 3 months ago
9.1.1-beta.140 51 3 months ago
9.1.1-beta.139 48 3 months ago
9.1.1-beta.138 48 3 months ago
9.1.1-beta.137 41 3 months ago
9.1.1-beta.136 43 3 months ago
9.1.1-beta.135 20 3 months ago
9.1.1-beta.134 23 3 months ago