rust-mc-status 3.0.0

High-performance asynchronous Rust library for querying Minecraft server status (Java & Bedrock)
Documentation
//! Proxy configuration for routing Minecraft pings through SOCKS5 or HTTP
//! CONNECT proxies.
//!
//! Enabled with `features = ["proxy"]` in `Cargo.toml`.
//!
//! # Supported proxy types
//!
//! | Constructor | Protocol | UDP (Bedrock) | Auth |
//! |-------------|----------|--------------|------|
//! | [`ProxyConfig::socks5`] | SOCKS5 | No | optional |
//! | [`ProxyConfig::socks5_with_udp`] | SOCKS5 + UDP ASSOCIATE | Yes | optional |
//! | [`ProxyConfig::http`] | HTTP CONNECT | No | optional (Basic) |
//!
//! # Quick start
//!
//! ```rust,no_run
//! use rust_mc_status::{McClient, ProxyConfig};
//!
//! # #[tokio::main] async fn main() -> Result<(), rust_mc_status::McError> {
//! // Anonymous SOCKS5
//! let client = McClient::builder()
//!     .proxy(ProxyConfig::socks5("127.0.0.1:1080"))
//!     .build();
//!
//! // Authenticated HTTP CONNECT
//! let client = McClient::builder()
//!     .proxy(ProxyConfig::http("squid.corp.example.com:3128")
//!         .with_auth("alice", "s3cr3t"))
//!     .build();
//! # Ok(()) }
//! ```
//!
//! # Bedrock and UDP
//!
//! Bedrock Edition uses UDP (RakNet).  Most SOCKS5 proxies and **all** HTTP
//! CONNECT proxies do not support UDP.  Attempting a Bedrock ping through such
//! a proxy returns
//! [`McError::Proxy(ProxyError::UdpUnsupported)`](crate::error::ProxyError)
//! immediately without making a network connection.
//!
//! Use [`ProxyConfig::socks5_with_udp`] only when your proxy server actually
//! advertises UDP ASSOCIATE support (e.g. `dante` with `udp_relay yes`,
//! or a `tun2socks` setup).

pub mod socks5;
#[cfg(feature = "proxy")]
pub mod http;

pub use socks5::{ProxyConfig, ProxyAuth, ProxyAddr, ProxyKind, UdpSupport};