diff options
| author | mat <git@matdoes.dev> | 2024-04-20 03:40:59 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-04-20 03:40:59 +0000 |
| commit | 353eda21ac8280213edcec3823cc3bd77fe17c44 (patch) | |
| tree | e57201568f99f3a3e9ebf7b8991b22b945bb65bc /azalea-client/src/client.rs | |
| parent | fa96af786b6f549edd8f04f4a19ced01faffe114 (diff) | |
| download | azalea-drasl-353eda21ac8280213edcec3823cc3bd77fe17c44.tar.xz | |
socks5 support (#113)
Diffstat (limited to 'azalea-client/src/client.rs')
| -rw-r--r-- | azalea-client/src/client.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index af535415..8ca0bbef 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -34,7 +34,7 @@ use azalea_entity::{ }; use azalea_physics::PhysicsPlugin; use azalea_protocol::{ - connect::{Connection, ConnectionError}, + connect::{Connection, ConnectionError, Proxy}, packets::{ configuration::{ serverbound_client_information_packet::ClientInformation, @@ -183,6 +183,7 @@ impl Client { pub async fn join( account: &Account, address: impl TryInto<ServerAddress>, + proxy: Option<Proxy>, ) -> Result<(Self, mpsc::UnboundedReceiver<Event>), JoinError> { let address: ServerAddress = address.try_into().map_err(|_| JoinError::InvalidAddress)?; let resolved_address = resolver::resolve_address(&address).await?; @@ -200,6 +201,7 @@ impl Client { account, &address, &resolved_address, + proxy, run_schedule_sender, ) .await @@ -212,6 +214,7 @@ impl Client { account: &Account, address: &ServerAddress, resolved_address: &SocketAddr, + proxy: Option<Proxy>, run_schedule_sender: mpsc::UnboundedSender<()>, ) -> Result<(Self, mpsc::UnboundedReceiver<Event>), JoinError> { // check if an entity with our uuid already exists in the ecs and if so then @@ -239,7 +242,11 @@ impl Client { entity }; - let conn = Connection::new(resolved_address).await?; + let conn = if let Some(proxy) = proxy { + Connection::new_with_proxy(resolved_address, proxy).await? + } else { + Connection::new(resolved_address).await? + }; let (conn, game_profile) = Self::handshake(ecs_lock.clone(), entity, conn, account, address).await?; |
