Skip to content

Latest commit

 

History

History
77 lines (59 loc) · 3 KB

README.md

File metadata and controls

77 lines (59 loc) · 3 KB

LocalSendDotNet.Core

LocalSendDotNet.Core is a UI-independent .NET 11 implementation of the LocalSend v2.2 protocol. It provides discovery, secure transfer, and receiving APIs for desktop apps, services, command-line tools, and other .NET hosts.

The library is maintained as part of the Tonarink repository. It is an unofficial implementation and is not affiliated with or endorsed by the official LocalSend project.

Install

dotnet add package LocalSendDotNet.Core --prerelease

The library targets .NET 11 and uses the ASP.NET Core shared framework for its embedded HTTP server.

Features

  • IPv4 multicast discovery and two-way registration
  • HTTP or HTTPS with a persisted RSA identity, mutual TLS, and certificate fingerprint pinning
  • Streaming file and text send/receive without buffering complete files
  • Partial acceptance, progress reporting, cancellation, and optional receiver PIN
  • Safe writes with path traversal protection, temporary files, and atomic publish
  • Bounded transfer concurrency, session timeouts, and SHA-256 verification
  • Device lifecycle events, trusted manual endpoints, and stream-backed send items
  • Folder enumeration with relative paths and common MIME type inference

Quick start

using LocalSendDotNet;

await using var node = new LocalSendNode(new LocalSendOptions
{
    Alias = "My app",
    DataDirectory = appDataDirectory,
    DownloadDirectory = downloadsDirectory
});

await node.StartAsync(cancellationToken);

await foreach (var request in node.WatchIncomingTransfersAsync(cancellationToken))
{
    _ = node.AcceptAsync(
        request.RequestId,
        progress: progress,
        cancellationToken: cancellationToken);
}

The Windows app and independent Tonarink.Cli share a System.CommandLine implementation for discovery, transfers and administration. See the CLI guide. Other .NET applications can use the platform-independent Core API directly.

Documentation

The public API is intentionally version-independent. Protocol-specific DTOs, routes, and serialization remain internal so a future protocol adapter can be added without changing the LocalSendNode calling model.

License and attribution

LocalSendDotNet.Core is licensed under the Apache License 2.0. Attribution and the relationship to the official LocalSend project are recorded in NOTICE.