pub struct ProxyBuilder { /* private fields */ }Expand description
Configuration for a reflection proxy. Build with
ReflectionProxy::builder.
Implementations§
Source§impl ProxyBuilder
impl ProxyBuilder
Sourcepub fn bind(self, addr: impl Into<String>) -> Self
pub fn bind(self, addr: impl Into<String>) -> Self
Local address the proxy listens on (default 127.0.0.1:25566;
use port 0 for an OS-assigned free port).
Sourcepub fn target(self, host: impl Into<String>) -> Self
pub fn target(self, host: impl Into<String>) -> Self
The real server, e.g. "mc.hypixel.net" or "host:port".
Sourcepub fn email(self, email: impl Into<String>) -> Self
pub fn email(self, email: impl Into<String>) -> Self
Microsoft account email. Tokens are cached (and refreshed) in
azalea’s standard cache file unless Self::auth_cache is set,
so interactive login happens at most once per account.
Sourcepub fn auth_cache(self, path: impl Into<PathBuf>) -> Self
pub fn auth_cache(self, path: impl Into<PathBuf>) -> Self
Override the auth token cache path (default:
~/.minecraft/azalea-auth.json, shared with azalea itself).
Sourcepub fn plugin(self, p: Box<dyn ProxyPlugin>) -> Self
pub fn plugin(self, p: Box<dyn ProxyPlugin>) -> Self
Add a frame-level plugin (Forward/Drop/Replace verdicts on raw packets, in registration order — the port of the original’s plugin pipeline).
Sourcepub fn whitelist<I: IntoIterator<Item = S>, S: Into<String>>(
self,
names: I,
) -> Self
pub fn whitelist<I: IntoIterator<Item = S>, S: Into<String>>( self, names: I, ) -> Self
Only allow these usernames to connect (case-insensitive). Empty (the default) = anyone who can reach the bind address.
Sourcepub fn max_clients(self, max: usize) -> Self
pub fn max_clients(self, max: usize) -> Self
Cap simultaneous clients (controller + viewers). Default: no cap.
Sourcepub fn always_first_control(self, on: bool) -> Self
pub fn always_first_control(self, on: bool) -> Self
When the controller disconnects, hand control to the oldest
connected viewer instead of going controllerless (the original’s
alwaysFirstControl). Default: off — the proxy stands in and the
session idles until someone runs ,acquire.
Sourcepub async fn spawn(self) -> Result<ReflectionProxy>
pub async fn spawn(self) -> Result<ReflectionProxy>
Bind the listener and start accepting clients in the background.