WebSockets 1.0.0
dotnet add package WebSockets --version 1.0.0
NuGet\Install-Package WebSockets -Version 1.0.0
<PackageReference Include="WebSockets" Version="1.0.0" />
<PackageVersion Include="WebSockets" Version="1.0.0" />
<PackageReference Include="WebSockets" />
paket add WebSockets --version 1.0.0
#r "nuget: WebSockets, 1.0.0"
#:package WebSockets@1.0.0
#addin nuget:?package=WebSockets&version=1.0.0
#tool nuget:?package=WebSockets&version=1.0.0
WebSockets
Targets net462 and net5.0. Full documentation is at https://scottoffen.github.io/websockets.
Is
WebSocketsstill maintained?It can be easy to assume that no activity on a repository and/or no updates in a long time means that a project has been abandoned. That is absolutely not the case here!
The reality is that this package is designed to fix an issue that isn't going to change, so we might go long stretches between updates, if there's ever another one needed at all. That's driven by a few things:
- .NET Framework 4.6.2, while still supported by Microsoft as part of Windows, is a stable, feature-frozen target that Microsoft's ongoing .NET investment has moved past.
- .NET 5.0 is out of official support - but we chose that target so that we could provide support for all future .NET versions.
- Microsoft treats this as intended behavior rather than a defect to patch, so there's no reason to expect it to disappear on its own in some future .NET release.
- Given that nothing here is expected to change, there's nothing that would obviously require this package to change either.
You can rest assured that this package will continue to be maintained if any issues are ever reported or new features requested.
Overview
WebSocketClient is a System.Net.WebSockets.ClientWebSocket replacement that performs the same handshake and reuses the same underlying native WebSocket implementation for framing, but treats Upgrade, Connection, and Sec-WebSocket-Accept header validation as overridable delegates with sensible, RFC 6455-compliant defaults, rather than hardcoding them internally the way ClientWebSocket does.
The default Connection check is the fix this package exists for. ClientWebSocket validates the handshake response more strictly than the spec requires: its Connection header check demands an exact match against "Upgrade", so a spec-legal response like Connection: Upgrade, Keep-Alive fails with:
System.Net.WebSockets.WebSocketException: The 'Connection' header value 'Upgrade, Keep-Alive' is invalid.
This affects both .NET Framework and modern .NET. The check is hardcoded on both platforms, with no option to relax it and no way to work around it from calling code. WebSocketClient's default Connection check instead treats the header as a comma-separated token list and accepts it as long as Upgrade is one of the tokens, rather than requiring an exact match against the whole value. A server responding with Connection: Upgrade, Keep-Alive connects successfully by default, no configuration required.
Need reconnection, backoff, or a send queue that survives a dropped connection? Check out WebSockets.Resilience.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. 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 Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- No dependencies.
-
net5.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on WebSockets:
| Package | Downloads |
|---|---|
|
WebSockets.Resilience
A resilient WebSocket wrapper. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 92 | 7/20/2026 |