RemoteIngress 1.0.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package RemoteIngress --version 1.0.0
                    
NuGet\Install-Package RemoteIngress -Version 1.0.0
                    
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="RemoteIngress" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RemoteIngress" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RemoteIngress" />
                    
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 RemoteIngress --version 1.0.0
                    
#r "nuget: RemoteIngress, 1.0.0"
                    
#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.
#:package RemoteIngress@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RemoteIngress&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RemoteIngress&version=1.0.0
                    
Install as a Cake Tool

RemoteIngress Client Library

A .NET client library for the Lazy Ingress (Ephemeral Debug Ingress) service.

Features

  • MuxClient: A strongly-typed HTTP client to register (Serve), remove (Unserve), and list routes on a Remote Ingress instance.
  • RouteRegistry: The core in-memory routing logic, decoupled from ASP.NET Core, allowing you to embed the routing logic in your own applications if needed.

Usage

MuxClient

using Rayneforge.RemoteIngress;

var http = new HttpClient();
var client = new MuxClient(http, new Uri("http://localhost:8080"), "dev-token");

// Register a route
// Maps http://ingress/api/... -> http://127.0.0.1:3000/...
var route = await client.ServeAsync("api", 3000);

// List active routes
var routes = await client.ListAsync();

// Remove a route
await client.UnserveAsync("api");

RouteRegistry

If you are building a custom ingress or need the routing logic directly:

using Rayneforge.RemoteIngress;

var registry = new RouteRegistry();

// Add a route
registry.Serve(new ServeRequest("api", 3000));

// Resolve a route
if (registry.TryGetRoute("api", out var route))
{
    Console.WriteLine($"Forward to {route.Host}:{route.Port}");
}

Building the Ingress Server

You can use RouteRegistry combined with YARP to build the full ingress server:

using System.Net;
using Rayneforge.RemoteIngress;
using Yarp.ReverseProxy.Forwarder;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpForwarder();
builder.Services.AddSingleton<RouteRegistry>();

var app = builder.Build();

var forwarder = app.Services.GetRequiredService<IHttpForwarder>();
var registry = app.Services.GetRequiredService<RouteRegistry>();
var httpClient = new HttpMessageInvoker(new SocketsHttpHandler());
var requestConfig = new ForwarderRequestConfig { ActivityTimeout = TimeSpan.FromMinutes(30) };

// --- Control Plane ---

app.MapPost("/_mux/serve", async (HttpContext ctx) =>
{
    var req = await ctx.Request.ReadFromJsonAsync<ServeRequest>();
    if (req is null) return Results.BadRequest();
    
    var entry = registry.Serve(req);
    return Results.Ok(entry);
});

app.MapDelete("/_mux/serve/{name}", (HttpContext ctx, string name) =>
{
    return registry.Unserve(name) ? Results.Ok() : Results.NotFound();
});

app.MapGet("/_mux/list", (HttpContext ctx) =>
{
    return Results.Ok(registry.List());
});

// --- Data Plane ---

app.Map("/{**catchAll}", async (HttpContext ctx) =>
{
    // Don't proxy admin paths
    if (ctx.Request.Path.StartsWithSegments("/_mux")) return;

    // Helper to extract "api" from "/api/users"
    if (!TryExtractName(ctx.Request.Path, out var name))
    {
        ctx.Response.StatusCode = 404;
        return;
    }

    if (registry.TryGetRoute(name, out var route) && route != null)
    {
        var destination = $"http://{route.Host}:{route.Port}";
        
        // Optional: Strip prefix logic
        if (route.StripPrefix)
        {
            var prefix = "/" + name;
            if (ctx.Request.Path.StartsWithSegments(prefix, out var rest))
                ctx.Request.Path = rest.HasValue ? rest : "/";
        }

        await forwarder.SendAsync(ctx, destination, httpClient, requestConfig);
    }
    else
    {
        ctx.Response.StatusCode = 404;
    }
});

app.Run();

static bool TryExtractName(PathString path, out string name)
{
    var s = path.Value ?? "";
    var parts = s.Split('/', StringSplitOptions.RemoveEmptyEntries);
    if (parts.Length == 0) { name = ""; return false; }
    name = RouteRegistry.NormalizeName(parts[0]);
    return name.Length > 0;
}
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 was computed.  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.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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