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:
[]
= { = "0.0.50", = ["core", "executor_tokio", "tls"] }
= { = "1", = ["full"] }
Quick Start
use *;
use Configuration;
async
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
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
# Run with specific features
# Generate documentation
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.