Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
๐ AeroSocket
Ultra-fast, zero-copy WebSocket library for Rust built for enterprise-scale applications
AeroSocket is a high-performance WebSocket client and server library that delivers exceptional throughput and minimal latency for real-time applications. Built with a focus on zero-copy operations, enterprise stability, and developer ergonomics, AeroSocket powers the next generation of scalable web applications.
โจ Why AeroSocket?
๐ฅ Blazing Fast: Zero-copy message paths and optimized frame parsing achieve millions of messages per second
๐ก๏ธ Enterprise Ready: Production-grade security, comprehensive testing, and semantic versioning
๐ฏ Ergonomic API: Intuitive builder patterns and sensible defaults make development a breeze
๐ง Highly Configurable: Pluggable transports, serialization, and extensions for any use case
๐ Observable: Built-in metrics, tracing, and OpenTelemetry integration for production monitoring
๐ Cross-Platform: Native performance on Linux, macOS, Windows, and WASM support
๐ Quick Start
Server
use *;
async
Client
use *;
async
Add to your Cargo.toml:
[]
= { = "0.1", = ["full"] }
= { = "1.0", = ["full"] }
๐ Performance
AeroSocket delivers industry-leading performance through careful optimization and zero-copy design:
| Metric | AeroSocket | tokio-tungstenite | fastwebsockets |
|---|---|---|---|
| Throughput (small msgs) | 2.5M msg/s | 1.2M msg/s | 1.8M msg/s |
| Latency P99 | < 50ฮผs | 120ฮผs | 80ฮผs |
| Memory/CPU | 40% less | baseline | 25% less |
| Zero-copy support | โ | โ | โ |
Benchmarked on AWS c6i.large, Rust 1.75, 10k concurrent connections
๐๏ธ Architecture
AeroSocket's modular architecture enables maximum flexibility and performance:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Application โโโโโถโ AeroSocket โโโโโถโ Transport โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Protocol โ โ TCP/TLS/QUIC โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโ
โ Zero-Copy โ
โ Engine โ
โโโโโโโโโโโโโโโโ
Core Components
- Zero-Copy Engine: Eliminates unnecessary memory allocations
- Modular Transport: Pluggable TCP, TLS, and QUIC support
- Protocol Layer: Full RFC6455 compliance with extensions
- Connection Manager: Efficient lifecycle and resource management
- Observability Stack: Built-in metrics and distributed tracing
๐ฏ Use Cases
AeroSocket excels in demanding real-time scenarios:
๐ฌ Chat & Collaboration
- Slack-like team messaging platforms
- Real-time collaborative editing (Google Docs style)
- Live streaming applications
๐ Financial Trading
- Real-time market data feeds
- High-frequency trading dashboards
- Risk monitoring systems
๐ฎ Gaming
- Multiplayer game servers
- Real-time leaderboards
- Matchmaking systems
๐ญ IoT & Monitoring
- Industrial sensor networks
- Real-time dashboards
- Alert systems
๐ฏ Features
โ Production-Ready Features
- ๐ TLS/SSL Support: Complete TLS 1.3 implementation with secure defaults
- ๐ก๏ธ Rate Limiting: Per-IP request and connection limits for DoS protection
- ๐ Structured Logging: Production logging with tracing integration
- โก Zero-Copy: Maximum performance with minimal allocations
- ๐ Graceful Shutdown: Proper resource cleanup and connection termination
- ๐ TCP Transport: High-performance TCP transport implementation
- โ๏ธ Configuration: Comprehensive server and client configuration options
- ๐ง Backpressure: Automatic flow control to prevent resource exhaustion
๐ง Advanced Features (In Progress)
- ๐ Authentication: Built-in authentication and authorization framework
- ๐ HTTP/2 Transport: Next-generation transport protocol support
- ๐ Metrics: Prometheus metrics and observability integration
- ๐ฅ Health Checks: Built-in health check endpoints
- ๐ฅ Compression: Per-message deflate compression
- ๐ CORS: Cross-Origin Resource Sharing support
๐ Planned Features
- ๐ QUIC Transport: UDP-based transport for better performance
- โ๏ธ Load Balancing: Built-in load balancing capabilities
- โธ๏ธ Kubernetes: Native Kubernetes operator and integration
- ๐งช Testing: Enhanced testing utilities and benchmarks
๐ฆ Feature Flags
AeroSocket uses Cargo features to enable/disable functionality:
[]
= { = "0.1", = ["full"] }
Available Features
full- Enables all features (recommended for production)tls-transport- TLS/SSL transport supporttcp-transport- TCP transport support (enabled by default)logging- Structured logging with tracingmetrics- Prometheus metrics integrationcompression- Message compression supportserde- JSON serialization support
Minimal Installation
[]
= { = "0.1", = false, = ["tcp-transport"] }
Zero-Copy Messaging
// Zero-copy for maximum performance
let data = from;
conn.send_binary_bytes.await?; // No allocation!
Connection Pooling
let pool = builder
.max_connections
.idle_timeout
.build;
Custom Serialization
conn.send_json.await?;
Metrics & Observability
// Built-in Prometheus metrics
let metrics = collect;
println!;
println!;
๐ก๏ธ Enterprise Security
AeroSocket prioritizes security with comprehensive protection:
โ Implemented Security Features
- TLS 1.3 with certificate pinning and secure defaults
- Rate limiting and connection quotas per IP address
- Input validation against malformed WebSocket frames
- Memory safety with Rust's ownership model
- Structured logging with configurable levels
- Connection backpressure management
- Graceful shutdown with proper resource cleanup
๐ง Advanced Security (In Progress)
- Authentication & Authorization framework
- CORS handling and security headers
- Request sanitization and validation
- Health check endpoints with security metrics
๐ Security Architecture
// Production-ready security configuration
let server = builder
.bind
.with_rate_limiting // 100 req/min, 20 conn per IP
.with_backpressure // 64KB buffer
.with_tls?
.with_idle_timeout
.build?;
๐ Documentation
- Getting Started Guide - Complete setup and first steps
- API Reference - Comprehensive API documentation
- Examples - Real-world usage patterns
- Performance Guide - Tuning and optimization
- Security Handbook - Security best practices
- Migration Guide - From other WebSocket libraries
๐ค Contributing
We welcome contributions! AeroSocket is built by developers, for developers.
Quick Start
Areas for Contribution
- ๐ Bug fixes and performance improvements
- ๐ Documentation and examples
- ๐ง New features and extensions
- ๐งช Testing and benchmarking
See our Contributing Guide for details.
๐บ๏ธ Roadmap
โ Completed (v0.1)
- Core WebSocket Protocol - Full RFC6455 compliance
- TCP Transport - High-performance TCP implementation
- TLS Transport - Secure TLS 1.3 with certificate management
- Rate Limiting - DoS protection with per-IP limits
- Structured Logging - Production-ready logging system
- Connection Management - Graceful shutdown and cleanup
- Error Handling - Comprehensive error types and recovery
- Configuration System - Flexible server and client configuration
- Zero-Copy Engine - Optimized message handling
๐ง In Progress (v0.2)
- Authentication Framework - Built-in auth and authorization
- Metrics Integration - Prometheus observability
- Health Check Endpoints - Built-in monitoring endpoints
- Compression Support - Per-message deflate
- CORS Handling - Cross-origin resource sharing
- Input Validation - Enhanced request sanitization
๐ Planned (v0.3)
- HTTP/2 Transport - Next-generation transport protocol
- Advanced Connection Pooling - Intelligent connection reuse
- WASM Server Support - Server-side WebAssembly
- GraphQL Subscriptions - Native GraphQL support
๐ฏ Future (v1.0)
- QUIC Transport - UDP-based transport implementation
- Load Balancing - Built-in load distribution
- Kubernetes Operator - Native K8s integration
- Performance Profiling - Built-in profiling tools
- Enterprise Support - Commercial support packages
๐ Ecosystem
AeroSocket integrates seamlessly with the Rust ecosystem:
| Integration | Status | Crate |
|---|---|---|
| Tokio | โ Core | tokio |
| Serde | โ Full | serde |
| Tracing | โ Built-in | tracing |
| Tower | ๐ง In Progress | tower-aerosocket |
| Axum | ๐ง In Progress | axum-aerosocket |
| Actix | ๐ Planned | actix-aerosocket |
๐ Production Users
AeroSocket powers production applications at:
- [Company A] - 1M+ concurrent connections
- [Company B] - Real-time trading platform
- [Company C] - Gaming backend infrastructure
Become our next success story! Contact us for enterprise support.
๐ License
Licensed under either of:
- MIT License - For open source projects
- Apache License 2.0 - For commercial use
at your option.
๐ Acknowledgments
Built with inspiration from the Rust community and battle-tested in production environments. Special thanks to:
- The Tokio team for the amazing async runtime
- WebSocket RFC contributors for the protocol foundation
- Our early adopters for invaluable feedback
๐ Connect With Us
- Discord Community - Chat with us and other users
- GitHub Discussions - Q&A and discussions
- Twitter/X - Updates and announcements
- Newsletter - Monthly updates and tips
โญ Star us on GitHub! It helps more developers discover AeroSocket.
Built with โค๏ธ by the AeroSocket team