47 releases
| 0.0.53 | Feb 17, 2026 |
|---|---|
| 0.0.49 | Jun 30, 2025 |
| 0.0.42 | Feb 2, 2025 |
| 0.0.39 | Oct 27, 2024 |
| 0.0.13 | Nov 13, 2023 |
#751 in Network programming
Used in 3 crates
1.5MB
21K
SLoC
Product OS : Server
Product OS : Server provides a full functioning advanced server capable of acting as a web server, command and control distributed network, authentication server, crawling server, and more. Fully featured with a high level of flexibility.
What is Product OS?
Product OS is a collection of packages that provide different tools and features that can work together to build products more easily for the Rust ecosystem.
Features
- Web Server: High-performance HTTP/HTTPS server built on Axum and Hyper
- TLS Support: Secure connections with Rustls
- Dual Protocol: Simultaneous HTTP and HTTPS on different ports
- WebSocket Support: Real-time bidirectional communication
- Server-Sent Events: Streaming updates to clients
- Compression: Gzip, Deflate, and Brotli response compression
- CORS: Cross-Origin Resource Sharing support
- CSRF Protection: Cross-Site Request Forgery protection
- CSP: Content Security Policy support
- Middleware: Extensible middleware system
- Command & Control: Distributed system coordination
- Multiple Executors: Tokio async runtime support
Installation
Add Product OS : Server to your Cargo.toml:
[dependencies]
product-os-server = { version = "0.0.53", features = ["core", "executor_tokio", "tls"] }
tokio = { version = "1", features = ["full"] }
Quick Start
use product_os_server::{ProductOSServer, ServerConfig};
use product_os_async_executor::TokioExecutor;
#[tokio::main]
async fn main() {
// Create server with default configuration
let config = ServerConfig::new();
let mut server: ProductOSServer<(), TokioExecutor, _> =
ProductOSServer::new_with_config(config);
// Add routes and start the server
// server.start(true).await;
}
Feature Flags
Core Features
core: Basic server functionality with Hyper, Axum, and loggingstd: Standard library support
Executors
executor_tokio: Tokio async runtime support
TLS
tls: TLS/HTTPS support with Rustlsdual_server: Simultaneous HTTP/HTTPS server
Communication
ws: WebSocket supportsse: Server-Sent Events support
Security
cors: CORS supportcspolicy: Content Security Policycsrf: CSRF protection
Middleware & Features
middleware: Extensible middleware supportcompression: Response compression (gzip, deflate, brotli)extract_headers: Header extraction utilities
Data Stores
controller: Command and Control with store supportpostgres_store: PostgreSQL database supportsqlite_store: SQLite database supportredis_key_value_store: Redis key-value storememory_key_value_store: In-memory key-value storefile_key_value_store: File-based key-value storeredis_queue_store: Redis queue storememory_queue_store: In-memory queue store
Configuration
{
"environment": "production",
"rootPath": "/api",
"network": {
"protocol": "https",
"secure": true,
"host": "0.0.0.0",
"port": 8443,
"listenAllInterfaces": true,
"allowInsecure": true,
"insecurePort": 8080,
"insecureUseDifferentPort": true,
"insecureForceSecure": true
},
"certificate": {
"certFile": "/path/to/cert.pem",
"keyFile": "/path/to/key.pem"
},
"compression": {
"enable": true,
"gzip": true,
"brotli": true
},
"security": {
"enable": true,
"csrf": true,
"csp": {
"defaultSrc": ["'self'"],
"scriptSrc": ["'self'", "'unsafe-inline'"]
}
}
}
Architecture
The server is built on:
- Hyper: Low-level HTTP implementation
- Axum: Web framework with routing and middleware
- Rustls: Modern TLS implementation
- Tower: Service abstraction for middleware
Integration
Product OS Server integrates with:
- Product OS Router: Request routing and handlers
- Product OS Configuration: Configuration management
- Product OS Security: Certificates and authentication
- Product OS Command Control: Distributed coordination
- Product OS Store: Data persistence
- Product OS Capabilities: Service/feature registration
Testing
# Run all tests
cargo test --all-features
# Run with specific features
cargo test --features "core,executor_tokio,tls"
# Generate documentation
cargo doc --all-features --open
License
Contributing
Contributions are welcome! Please ensure:
- All tests pass:
cargo test --all-features - Code is formatted:
cargo fmt - No clippy warnings:
cargo clippy --all-features - Documentation is updated for public APIs
Minimum Supported Rust Version (MSRV)
Rust 1.69 or later.
Dependencies
~22–47MB
~735K SLoC