Expand description
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
use rust_mc_status::{McClient, ProxyConfig};
// 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();§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)
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).
Re-exports§
pub use socks5::ProxyConfig;pub use socks5::ProxyAuth;pub use socks5::ProxyAddr;pub use socks5::ProxyKind;pub use socks5::UdpSupport;