aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-protocol/src')
-rw-r--r--azalea-protocol/src/connect.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs
index 3d375dfc..8d2711a7 100644
--- a/azalea-protocol/src/connect.rs
+++ b/azalea-protocol/src/connect.rs
@@ -1,6 +1,6 @@
//! Connect to remote servers/clients.
-use std::fmt::Debug;
+use std::fmt::{self, Debug, Display};
use std::io::{self, Cursor};
use std::marker::PhantomData;
use std::net::SocketAddr;
@@ -274,6 +274,15 @@ impl Proxy {
Self { addr, auth }
}
}
+impl Display for Proxy {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "socks5://")?;
+ if let Some(auth) = &self.auth {
+ write!(f, "{}@", auth)?;
+ }
+ write!(f, "{}", self.addr)
+ }
+}
impl Connection<ClientboundHandshakePacket, ServerboundHandshakePacket> {
/// Create a new connection to the given address.