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

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.249
                    
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Ngrok -Version 9.3.1-beta.249
                    
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.249" />
                    
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.249" />
                    
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.249
                    
#r "nuget: CommunityToolkit.Aspire.Hosting.Ngrok, 9.3.1-beta.249"
                    
#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.249&prerelease
                    
Install CommunityToolkit.Aspire.Hosting.Ngrok as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Ngrok&version=9.3.1-beta.249&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.277 3 9 hours ago
9.4.1-beta.276 1 9 hours ago
9.4.1-beta.275 31 18 hours ago
9.4.1-beta.274 30 18 hours ago
9.4.1-beta.273 31 18 hours ago
9.4.1-beta.272 29 18 hours ago
9.4.1-beta.271 31 18 hours ago
9.4.1-beta.270 60 3 days ago
9.4.0 73 3 days ago
9.4.0-beta.269 44 3 days ago
9.4.0-beta.268 37 4 days ago
9.3.1-beta.267 42 4 days ago
9.3.1-beta.266 44 4 days ago
9.3.1-beta.265 146 9 days ago
9.3.1-beta.264 148 9 days ago
9.3.1-beta.263 145 9 days ago
9.3.1-beta.262 148 9 days ago
9.3.1-beta.260 117 13 days ago
9.3.1-beta.259 116 16 days ago
9.3.1-beta.258 120 16 days ago
9.3.1-beta.257 121 16 days ago
9.3.1-beta.256 114 16 days ago
9.3.1-beta.255 115 16 days ago
9.3.1-beta.254 113 16 days ago
9.3.1-beta.253 117 23 days ago
9.3.1-beta.252 91 a month ago
9.3.1-beta.250 93 a month ago
9.3.1-beta.249 90 a month ago
9.3.1-beta.248 94 a month ago
9.3.1-beta.247 94 a month ago
9.3.1-beta.244 443 a month ago
9.3.1-beta.242 442 a month ago
9.3.1-beta.241 112 a month ago
9.3.0 430 a month ago
9.3.0-beta.239 108 a month ago
9.2.2-beta.237 118 a month ago
9.2.2-beta.236 78 a month ago
9.2.2-beta.230 111 a month ago
9.2.2-beta.229 110 a month ago
9.2.2-beta.228 125 a month ago
9.2.2-beta.227 121 a month ago
9.2.2-beta.226 123 a month ago
9.2.2-beta.225 114 a month ago
9.2.2-beta.224 118 a month ago
9.2.2-beta.223 126 a month ago
9.2.2-beta.222 126 a month ago
9.2.2-beta.220 119 a month ago
9.2.2-beta.218 121 a month ago
9.2.2-beta.217 160 2 months ago
9.2.2-beta.216 165 2 months ago
9.2.2-beta.215 162 2 months ago
9.2.2-beta.214 163 2 months ago
9.2.2-beta.213 153 2 months ago
9.2.2-beta.212 157 2 months ago
9.2.2-beta.211 159 2 months ago
9.2.2-beta.210 160 2 months ago
9.2.2-beta.208 62 2 months ago
9.2.1 113 2 months ago
9.2.1-beta.207 81 2 months ago
9.2.1-beta.206 55 2 months ago
9.2.1-beta.205 57 2 months ago
9.2.1-beta.204 54 2 months ago
9.2.1-beta.203 52 2 months ago
9.2.0 107 2 months ago
9.2.0-beta.202 47 2 months ago
9.2.0-beta.201 56 2 months ago
9.2.0-beta.199 54 2 months ago
9.2.0-beta.198 48 2 months ago
9.1.1-beta.197 57 2 months ago
9.1.1-beta.196 60 2 months ago
9.1.1-beta.195 52 2 months ago
9.1.1-beta.194 56 2 months ago
9.1.1-beta.193 59 2 months ago
9.1.1-beta.192 59 2 months ago
9.1.1-beta.191 101 2 months ago
9.1.1-beta.190 63 2 months ago
9.1.1-beta.189 53 2 months ago
9.1.1-beta.188 60 2 months ago
9.1.1-beta.187 66 2 months ago
9.1.1-beta.183 66 2 months ago
9.1.1-beta.182 61 2 months ago
9.1.1-beta.181 76 2 months ago
9.1.1-beta.180 61 2 months ago
9.1.1-beta.178 59 2 months ago
9.1.1-beta.177 73 2 months ago
9.1.1-beta.176 69 2 months ago
9.1.1-beta.175 60 2 months ago
9.1.1-beta.173 63 2 months ago
9.1.1-beta.169 60 3 months ago
9.1.1-beta.168 52 3 months ago
9.1.1-beta.166 57 3 months ago
9.1.1-beta.165 48 3 months ago
9.1.1-beta.164 59 3 months ago
9.1.1-beta.162 58 3 months ago
9.1.1-beta.155 56 3 months ago
9.1.1-beta.154 51 3 months ago
9.1.1-beta.153 50 3 months ago
9.1.1-beta.152 46 3 months ago
9.1.1-beta.150 57 3 months ago
9.1.1-beta.148 60 3 months ago
9.1.1-beta.147 51 3 months ago
9.1.1-beta.146 55 3 months ago
9.1.1-beta.145 49 3 months ago
9.1.1-beta.144 50 3 months ago
9.1.1-beta.142 53 3 months ago
9.1.1-beta.140 53 3 months ago
9.1.1-beta.139 50 3 months ago
9.1.1-beta.138 50 3 months ago
9.1.1-beta.137 43 3 months ago
9.1.1-beta.136 45 3 months ago
9.1.1-beta.135 22 3 months ago
9.1.1-beta.134 25 3 months ago