aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/join.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2025-12-11 22:47:16 -0600
committerGitHub <noreply@github.com>2025-12-11 22:47:16 -0600
commit4a66f002c276a57e028e9456f6800b0b3c248885 (patch)
treef87cbdc51c09d497548f972b9b1633ceb7606443 /azalea-client/src/plugins/join.rs
parentff1e28f88e93ba83cf76569b5613445b841efd45 (diff)
downloadazalea-drasl-4a66f002c276a57e028e9456f6800b0b3c248885.tar.xz
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
Diffstat (limited to 'azalea-client/src/plugins/join.rs')
-rw-r--r--azalea-client/src/plugins/join.rs17
1 files changed, 15 insertions, 2 deletions
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<Proxy>,
+ /// The SOCKS5 proxy used for connecting to the Minecraft server.
+ pub server_proxy: Option<Proxy>,
+ /// 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<Proxy>,
}
/// 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<LoginConn, ConnectionError> {
- 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?