WebSocket.Rx
0.1.0
See the version list below for details.
dotnet add package WebSocket.Rx --version 0.1.0
NuGet\Install-Package WebSocket.Rx -Version 0.1.0
<PackageReference Include="WebSocket.Rx" Version="0.1.0" />
<PackageVersion Include="WebSocket.Rx" Version="0.1.0" />
<PackageReference Include="WebSocket.Rx" />
paket add WebSocket.Rx --version 0.1.0
#r "nuget: WebSocket.Rx, 0.1.0"
#:package WebSocket.Rx@0.1.0
#addin nuget:?package=WebSocket.Rx&version=0.1.0
#tool nuget:?package=WebSocket.Rx&version=0.1.0
WebSocket.Rx
WebSocket.Rx is a powerful .NET NuGet package for reactive WebSocket communication using Reactive Extensions (Rx.NET).
<img alt="WebSocket.Rx logo" height="128" src="https://raw.githubusercontent.com/st0o0/WebSocket.Rx/refs/heads/main/docs/logo/logo.png" width="128"/>
Installation
dotnet add package WebSocket.Rx
Requires: System.Reactive and a WebSocket implementation like Websocket.Client.
Features
- Reactive Streams: Observable sequences for
MessageReceived,ReconnectionHappened,StateChanged - Automatic Reconnecting: Configurable with backoff strategy
- Thread-Safe Processing:
ObserveOnfor UI or scheduler integration - Send Queue: Asynchronous messaging with automatic buffering
Usage
using WebSocket.Rx;
using System.Reactive.Linq;
var client = new WebSocketRxClient("wss://echo.websocket.org")
{
ReconnectTimeout = TimeSpan.FromSeconds(5)
};
client.MessageReceived
.Where(msg => msg.Text.Contains("ping"))
.Subscribe(msg => client.Send("pong"));
client.StateChanged.Where(state => state == WebSocketState.Open)
.Subscribe(_ => client.Send("Connected!"));
await client.ConnectAsync();
Configuration
var options = new WebSocketRxOptions
{
LoggerFactory = LoggerFactory.Create(builder => builder.AddConsole()),
AutomaticReconnect = true,
ReconnectTimeout = TimeSpan.FromSeconds(3)
};
Contributing
Contributions are welcome! This library grows with the community's needs.
How to Contribute
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Write tests for your changes
- Ensure all tests pass:
dotnet test - Submit a Pull Request
Contribution Guidelines
- Follow existing code style and conventions
- Include unit tests for new features
- Update documentation for API changes
- Keep changes focused and atomic
License
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ for the .NET
For questions, support, or feature requests, please open an issue.
| 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
- System.Reactive (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
🎯 WebSocket.Rx v0.1.0
📦 NuGet: https://nuget.org/packages/WebSocket.Rx
🔗 Release: https://github.com/st0o0/WebSocket.Rx/releases/v0.1.0
See release page for full changelog and details!
Built with ❤️