CloudPub.Client 1.5.7

dotnet add package CloudPub.Client --version 1.5.7
                    
NuGet\Install-Package CloudPub.Client -Version 1.5.7
                    
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="CloudPub.Client" Version="1.5.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CloudPub.Client" Version="1.5.7" />
                    
Directory.Packages.props
<PackageReference Include="CloudPub.Client" />
                    
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 CloudPub.Client --version 1.5.7
                    
#r "nuget: CloudPub.Client, 1.5.7"
                    
#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 CloudPub.Client@1.5.7
                    
#: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=CloudPub.Client&version=1.5.7
                    
Install as a Cake Addin
#tool nuget:?package=CloudPub.Client&version=1.5.7
                    
Install as a Cake Tool

CloudPub .NET SDK

Expose local HTTP, HTTPS, TCP, UDP, and other services to the internet through CloudPub — similar in spirit to ngrok-style tunnels, with a control WebSocket, protobuf protocol, and optional ASP.NET Core integration with fluent builder setup.

This repository ships two NuGet packages:

Package When to use
CloudPub.Client Console apps, workers, or any .NET Standard 2.1+ library.
CloudPub.AspNet ASP.NET Core apps on .NET 10+ that should auto-publish when the web host starts.

Both packages share the root namespace CloudPub (types such as CloudPubClient, CloudPub.Options.CloudPubClientOptions).


Installation

dotnet add package CloudPub.Client

For ASP.NET Core integration:

dotnet add package CloudPub.AspNet

(CloudPub.AspNet references CloudPub.Client; you do not need to add the client package separately unless you want an explicit reference.)


Authentication

The agent handshake accepts either:

  • Token — set CloudPubClientOptions.Token (e.g. from environment or user secrets), or
  • Email + password — set Email and Password.

You can also point ServerUri at another control plane (default is https://cloudpub.ru).


Using the client library

Minimal example (publish HTTP on localhost)

using CloudPub;
using CloudPub.Options;
using CloudPub.Protocol;

CloudPubClientOptions options = new CloudPubClientOptions
{
    Email = "you@example.com",
    Password = "your-password",
    // Or: Token = "your-token",
};

await using CloudPubClient client = new CloudPubClient(options, new CloudPubRules());
await client.ConnectAsync();

Endpoint endpoint = await client.PublishAsync(new CloudPubPublishOptions
{
    Protocol = ProtocolType.Http,
    Address = "8080",              // localhost:8080 (or host:port, URL, etc.)
    Name = "my-app",
    Auth = AuthType.None,
});

Console.WriteLine($"Public URL: {endpoint.Url}");
// … keep running …
await client.UnpublishAsync(endpoint);

Extension helpers (CloudPubClientExtensions)

After ConnectAsync, use the static extension methods on ICloudPubClient:

Method Purpose
PublishAsync Register a new publication from CloudPubPublishOptions.
UnpublishAsync Remove a publication and mark the endpoint offline.
StopAsync Stop traffic without removing registration.
CleanAsync Clear all publications on the account.
ListAsync List current endpoints.

CloudPubClientOptions (common properties)

Property Description
ServerUri Control server (default https://cloudpub.ru). WebSocket URL is derived from this.
Timeout Handshake / wait timeouts (default 30 seconds).
ResumeEndpointsOnConnect When true, the transport may send EndpointStartAll after connect.
Token Session token after login, or pre-provisioned token.
Email / Password Account credentials for hello handshake.
AgentId Stable agent id; a new GUID is used if empty.
Hwid Optional hardware id string.
ClientVersion Reported client version string.

CloudPubPublishOptions (publishing)

Property Description
Protocol e.g. Http, Https, Tcp, Udp, Ssh, …
Address Port only, host:port, path, or full URL — see XML docs on CreateCleintEndpoint.
Name Friendly description stored on the endpoint.
Auth Optional; defaults (e.g. Basic for WebDAV) apply when null.
Acl, Headers, Rules Optional access lists, headers, and filter rules.

ASP.NET Core addon (CloudPub.AspNet)

The addon wires ICloudPubClient into DI and uses a fluent ICloudPubClientBuilder.

Startup and shutdown responsibilities are split:

  1. HostedCloudPubLifetimeService: connect/publish on startup, unpublish on shutdown.
  2. HostedCloudPubLocalhostProxyService: localhost address projection into IServerAddressesFeature.
  3. HostedCloudPubPipelineProxyService: HTTP request forwarding directly into ASP.NET pipeline.

1. Register client + options

Pick one style.

Option A — bind from configuration (recommended)

appsettings.json:

{
  "CloudPub": {
    "ServerUri": "https://cloudpub.ru",
    "Email": "you@example.com",
    "Password": "your-password"
  }
}

Program:

using CloudPub;

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

builder.Services.AddCloudPub(builder.Configuration.GetSection("CloudPub"));

Option B — inline options

builder.Services.AddCloudPub(new CloudPub.Options.CloudPubClientOptions
{
    Token = builder.Configuration["CloudPub:Token"]!,
});

Option C — custom factory

builder.Services.AddCloudPub(sp =>
{
    CloudPub.Options.CloudPubClientOptions o = sp.GetRequiredService<IOptions<CloudPub.Options.CloudPubClientOptions>>().Value;
    return new CloudPubClient(o, sp.GetRequiredService<ICloudPubRules>());
});

2. Declare endpoints and proxy mode

Use the fluent builder returned by AddCloudPub(...):

builder.Services
    .AddCloudPub(builder.Configuration.GetSection("CloudPub"))
    .AddEndpoint(5000, "My API")
    .AddEndpoint(new CloudPub.Options.CloudPubPublishOptions
    {
        Protocol = CloudPub.Protocol.ProtocolType.Https,
        Address = "5001",
        Name = "Secure API",
    })
    .WithLocalhostProxy();

WithLocalhostProxy() and WithPipelineProxy() are mutually exclusive.

3. Add Post\Pre connection actions

Use WebApplication extension method OnCloudPubStarted and OnCloudPubStopped

WebApplication app = builder.Build();
app.OnCloudPubStarted(ctx =>
{
    Endpoint endpoint = ctx.PublishedEndpoints.FirstOrDefault()
        ?? throw new InvalidOperationException("No endpoints found");

    telegramBotClient.RemapWebhook(endpoint.Url + "telegram/");
});

app.Run();

Full minimal Program.cs sketch

using CloudPub;

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);

builder.Services
    .AddCloudPub(builder.Configuration.GetSection("CloudPub"))
    .AddEndpoint(5000, "Sample site")
    .WithPipelineProxy();

WebApplication app = builder.Build();
app.MapGet("/", () => "Hello from CloudPub!");
app.Run();

Requirements: a server that exposes IServerAddressesFeature (Kestrel does). The hosted service throws at startup if the feature is missing.


Sample console project

The solution includes CloudPub.Example: a CLI-style app with argument parsing and commands:

  • list
  • publish --address <addr> --protocol <proto> [--name <text>] [--auth <mode>] [--wait]
  • publish-http <port> [--wait] (shortcut)
  • stop --guid <guid>
  • unpublish --guid <guid>
  • clean

It reads auth settings from CLOUDPUB_* variables or explicit CLI options (--token, --email, --password, --server).

Examples:

set CLOUDPUB_EMAIL=you@example.com
set CLOUDPUB_PASSWORD=secret
dotnet run --project src/CloudPub.Example/CloudPub.Example.csproj -- list
dotnet run --project src/CloudPub.Example/CloudPub.Example.csproj -- publish --protocol tcp --address 127.0.0.1:25565 --name "Minecraft"
dotnet run --project src/CloudPub.Example/CloudPub.Example.csproj -- publish-http 8080 --wait

(Use CLOUDPUB_TOKEN instead of email/password if you prefer.)


Building from source

git clone <repository-url>
cd CloudPub.Client
dotnet build CloudPub.Sdk.slnx -c Release

Packages are emitted under bin/Release/ when GeneratePackageOnBuild is enabled.


Repository and license

  • Repository: see the package metadata (e.g. RepositoryUrl in the .csproj files).
  • License: see the LICENSE file bundled with the package.

For API details, open the XML documentation shipped with each package or browse the /// comments in the source.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CloudPub.Client:

Package Downloads
CloudPub.AspNet

The CloudPub C# SDK provides a simple interface for interacting with the CloudPub platform. CloudPub provides secure tunneling and service publishing, allowing you to securely expose local services to the internet.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.7 107 4/24/2026
1.5.6 100 4/24/2026
1.5.5 101 4/23/2026
1.5.4 97 4/23/2026
1.5.3 102 4/16/2026
1.5.0 115 4/13/2026
1.4.0 107 4/4/2026
1.3.0 105 4/4/2026
1.2.0 101 4/3/2026
1.1.0 117 4/3/2026
1.0.0 106 4/3/2026