Expand description
§NNTP Proxy Library
A high-performance NNTP proxy server implementation with two operating modes: 1:1 mode (one backend per client) and per-command routing mode.
§Architecture
The proxy is organized into several modules for clean separation of concerns:
- auth: Authentication handling for both client and backend connections
- command: NNTP command parsing and classification
- config: Configuration loading and management
- pool: Connection and buffer pooling for high performance
- protocol: NNTP protocol constants and response parsing
- proxy: Main proxy orchestration (
NntpProxystruct) - router: Backend selection and load balancing
- types: Core type definitions (
ClientId,RequestId,BackendId)
§Design Philosophy
This proxy operates in stateless mode, rejecting commands that require maintaining session state (like GROUP, NEXT, LAST). This design enables:
- Simpler architecture with clear separation of concerns
- Per-command routing mode where each command can use a different backend
- Easy testing and maintenance of individual components
§Operating Modes
- 1:1 mode: Traditional mode where each client gets a dedicated backend connection
- Per-command routing mode: Each command is routed to a backend (round-robin), but commands are still processed serially (NNTP is synchronous)
Re-exports§
pub use args::CacheArgs;pub use args::CommonArgs;pub use config::Cache;pub use config::Config;pub use config::ConfigSource;pub use config::RoutingMode;pub use config::Server;pub use config::create_default_config;pub use config::has_server_env_vars;pub use config::load_config;pub use config::load_config_from_env;pub use config::load_config_with_fallback;pub use runtime::RuntimeConfig;pub use runtime::shutdown_signal;
Modules§
- args
- Command-line argument parsing for NNTP proxy binaries
- auth
- Authentication module
- backend
- Backend communication utilities for NNTP client operations
- cache
- Cache module for NNTP article caching
- client
- Standalone NNTP client for fetching articles
- command
- Command processing module
- config
- Configuration module
- connection_
error - Connection error types for the NNTP proxy
- constants
- Constants used throughout the NNTP proxy
- formatting
- Log formatting utilities
- logging
- Centralized logging setup with dual output (stdout + debug.log)
- metrics
- Real-time metrics collection for the NNTP proxy
- network
- Network socket optimization utilities
- pool
- Connection pooling and buffer pooling modules
- protocol
- NNTP protocol handling module
- router
- Backend server selection and load balancing
- runtime
- Tokio runtime configuration and common utilities for binary targets
- session
- Session management module
- stream
- Stream abstraction for supporting multiple connection types
- streaming
- Streaming utilities for reading NNTP multiline responses
- tls
- TLS configuration and handshake management for NNTP connections
- tui
- Terminal User Interface (TUI) for the NNTP proxy
- types
- Core types for request tracking and identification
Structs§
- Nntp
Proxy - Nntp
Proxy Builder - Builder for constructing an
NntpProxywith optional configuration overrides
Functions§
- is_
client_ disconnect_ error - Classify an error as a client disconnect (broken pipe/connection reset)