From 4a66f002c276a57e028e9456f6800b0b3c248885 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:47:16 -0600 Subject: Add options to request Mojang sessionserver with a proxy (#293) * add options to request mojang sessionserver with a socks5 proxy * update changelog * rename auth_proxy to sessionserver_proxy --- azalea-client/src/plugins/join.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'azalea-client/src/plugins/join.rs') diff --git a/azalea-client/src/plugins/join.rs b/azalea-client/src/plugins/join.rs index a8f6e3c5..538369b0 100644 --- a/azalea-client/src/plugins/join.rs +++ b/azalea-client/src/plugins/join.rs @@ -64,9 +64,22 @@ pub struct StartJoinServerEvent { /// This is inserted as a component on clients to make auto-reconnecting work. #[derive(Debug, Clone, Component)] pub struct ConnectOpts { + /// The unresolved address that we're going to tell the server that we used + /// to connect. pub address: ServerAddress, + /// The actual IP and port that we're going to make a connection to. pub resolved_address: SocketAddr, - pub proxy: Option, + /// The SOCKS5 proxy used for connecting to the Minecraft server. + pub server_proxy: Option, + /// The SOCKS5 proxy that will be used when authenticating our server join + /// with Mojang. + /// + /// This should typically be either the same as [`Self::server_proxy`], or + /// `None`. + /// + /// This is useful to set if a server has `prevent-proxy-connections` + /// enabled. + pub sessionserver_proxy: Option, } /// An event that's sent when creating the TCP connection and sending the first @@ -158,7 +171,7 @@ pub fn handle_start_join_server_event( async fn create_conn_and_send_intention_packet( opts: ConnectOpts, ) -> Result { - let mut conn = if let Some(proxy) = opts.proxy { + let mut conn = if let Some(proxy) = opts.server_proxy { Connection::new_with_proxy(&opts.resolved_address, proxy).await? } else { Connection::new(&opts.resolved_address).await? -- cgit v1.2.3