1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! 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 use ;