HostLoom.AspNetCore.WebSockets.Testing
0.18.0
dotnet add package HostLoom.AspNetCore.WebSockets.Testing --version 0.18.0
NuGet\Install-Package HostLoom.AspNetCore.WebSockets.Testing -Version 0.18.0
<PackageReference Include="HostLoom.AspNetCore.WebSockets.Testing" Version="0.18.0" />
<PackageVersion Include="HostLoom.AspNetCore.WebSockets.Testing" Version="0.18.0" />
<PackageReference Include="HostLoom.AspNetCore.WebSockets.Testing" />
paket add HostLoom.AspNetCore.WebSockets.Testing --version 0.18.0
#r "nuget: HostLoom.AspNetCore.WebSockets.Testing, 0.18.0"
#:package HostLoom.AspNetCore.WebSockets.Testing@0.18.0
#addin nuget:?package=HostLoom.AspNetCore.WebSockets.Testing&version=0.18.0
#tool nuget:?package=HostLoom.AspNetCore.WebSockets.Testing&version=0.18.0
HostLoom.AspNetCore.WebSockets.Testing
In-process test client helpers for HostLoom.AspNetCore.WebSockets applications hosted by
ASP.NET Core TestServer.
await using var client = new WebSocketTestClient(server);
client.ConfigureRequest = request => request.Headers.Origin = "https://app.example";
await client.ConnectAsync(new Uri("ws://localhost/hostloom"), cancellationToken);
var welcome = await client.AwaitWelcomeAsync(cancellationToken);
// Stream identifiers are Guids; the client picks one per stream and never reuses it.
var streamId = Guid.NewGuid();
await client.SendAsync(
new HubFrame
{
Kind = HubFrameKind.Subscribe,
StreamId = streamId,
Topic = "orders.changed",
Key = "customer-1",
Credit = 8,
},
cancellationToken);
await client.AwaitSubscribedAsync(streamId, cancellationToken);
ConfigureRequest can add an Origin, cookies, or test authentication headers to the upgrade.
The client negotiates hostloom.json.v1 by default; pass another IWebSocketHubProtocol to its
constructor to exercise a different codec.
A close the server starts, such as session expiry or an administrative disconnect, ends the
session only after the client answers it or the gateway's CloseTimeout elapses. Answer it with
client.Socket.CloseOutputAsync when a test expects the session to finish.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- HostLoom.AspNetCore.WebSockets (>= 0.18.0)
- Microsoft.AspNetCore.TestHost (>= 10.0.14)
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 |
|---|---|---|
| 0.18.0 | 0 | 10/27/2026 |
| 0.17.0 | 53 | 10/25/2026 |
| 0.16.1 | 47 | 10/22/2026 |
| 0.16.0 | 87 | 10/14/2026 |
| 0.15.1 | 84 | 10/12/2026 |
| 0.15.0 | 108 | 10/4/2026 |
| 0.14.0 | 94 | 10/4/2026 |
| 0.13.0 | 94 | 9/28/2026 |
| 0.12.0 | 100 | 9/27/2026 |
| 0.11.0 | 100 | 9/25/2026 |
| 0.10.0 | 105 | 9/22/2026 |
| 0.9.0 | 98 | 9/22/2026 |
| 0.8.0 | 110 | 9/19/2026 |
| 0.7.0 | 112 | 9/17/2026 |
| 0.6.0 | 122 | 9/6/2026 |
| 0.5.0 | 112 | 9/5/2026 |
| 0.4.0 | 118 | 9/3/2026 |