Skip to content

About

ArgusTransfer is framework that provides routing over named pipes inspired by the HTTP 1.1 request/response protocol. It is typically used to host services running in the background for which you would like to expose a REST like API but running a fully fledged HTTP server is too heavy or not allowed.

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

120 Commits

Folders and files

Repository files navigation

ArgusTransfer

ArgusTransfer

HTTP-style request/response routing over named pipes for .NET.

NuGet Build Status Quality Gate Status Coverage

Why ArgusTransfer?

ArgusTransfer lets a background process -- typically a Windows service or a hosted worker -- expose a REST-like API to other processes on the same machine, without running an HTTP server. You map verbs and routes to handlers, like a minimal web API, and clients call them over a named pipe using a small text protocol (ARGUS/1.0) modeled on HTTP/1.1.

Use it when an HTTP server is too heavy, not allowed, or would open a network port you don't want. It is not meant for communication across machines or with browsers -- use HTTP for that.

Features

  • Routing and modules -- MapGet/MapPost/... with route parameters and Guid / ShortGuid constraints, organized in modules discovered automatically. Routing and Modules
  • Middleware -- global and per-endpoint, with built-in logging and exception handling. Middleware
  • Client -- typed verb methods, query parameters, timeouts, streaming bodies and automatic retries for transient pipe failures. Client Usage
  • Structured errors -- RFC 7807 problem details for error responses. Error Handling
  • Authentication -- Authorization header convention and pluggable authentication middleware. Authentication
  • Compression -- gzip Content-Encoding for request and response bodies. Compression
  • Content negotiation -- pluggable body serializers selected by Content-Type and Accept. Serialization
  • Hosting -- integrates with Microsoft.Extensions.Hosting and dependency injection, with concurrency limits, request timeouts, graceful shutdown and Windows pipe security for services. Server Configuration

Requires .NET 10. Developed on Windows and tested on Linux and Windows in CI; on Linux and macOS, .NET named pipes are Unix domain sockets, and pipe ACLs (PipeSecurity) apply to Windows only.

Install

dotnet add package ArgusTransfer
dotnet add package Microsoft.Extensions.Hosting

Quick start

A console app that hosts one endpoint and calls it -- in a real system the host and the client are separate processes:

using ArgusTransfer.Client;
using ArgusTransfer.Extensions;
using ArgusTransfer.Protocol;
using ArgusTransfer.Routing;

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var builder = Host.CreateApplicationBuilder(args);

builder.Services.AddArgusModules();                                  // discovers HelloModule
builder.Services.AddArgusPipeHost(options => options.PipeName = "hello");
builder.Services.AddArgusClient("hello");

using var host = builder.Build();
await host.StartAsync();

var client = host.Services.GetRequiredService<IArgusClient>();
var response = await client.GetAsync("/hello/world");

Console.WriteLine($"{(int)response.StatusCode} {response.Body}");   // 200 Hello, world!

await host.StopAsync();

public class HelloModule : IArgusModule
{
    public void AddRoutes(IArgusRouteBuilder app)
    {
        app.MapGet("/hello/{name}", context =>
        {
            context.Response = new ArgusResponse
            {
                StatusCode = ArgusStatusCode.Ok,
                Body = $"Hello, {context.RouteValues["name"]}!"
            };

            return Task.CompletedTask;
        });
    }
}

The Quick Start guide walks through a separate server and client, and the sample project shows a complete CRUD module with JSON bodies, problem details, authentication, a client retry policy and compression.

Documentation

The wiki is the reference documentation:

Contributing

Bug reports and feature requests are welcome as GitHub issues. See CONTRIBUTING for how to make changes and submit pull requests, and the Development Environment page for building and testing. Builds and tests run on GitHub Actions, and code quality is tracked on SonarCloud.

Software Bill of Materials

Every NuGet package ships with a Software Bill of Materials (SBOM) generated during the build. It lists the third-party components, versions and licenses the package depends on, so you can track vulnerabilities and audit licensing.

License

ArgusTransfer is licensed under the Apache License 2.0.

About

ArgusTransfer is framework that provides routing over named pipes inspired by the HTTP 1.1 request/response protocol. It is typically used to host services running in the background for which you would like to expose a REST like API but running a fully fledged HTTP server is too heavy or not allowed.

Resources

Code of conduct

Contributing

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages