summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2024-11-30 18:23:25 +0100
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-12-02 10:40:50 +0100
commit728ea4b5329d56596277dcd17678530a46d64fce (patch)
tree1d9922165b81172730a73721559d516191f330df
parentd8e31a9eddc357a32d635ff5967ac61960862021 (diff)
downloadmullvadvpn-728ea4b5329d56596277dcd17678530a46d64fce.tar.xz
mullvadvpn-728ea4b5329d56596277dcd17678530a46d64fce.zip
Clean up import
-rw-r--r--mullvad-encrypted-dns-proxy/src/forwarder.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/mullvad-encrypted-dns-proxy/src/forwarder.rs b/mullvad-encrypted-dns-proxy/src/forwarder.rs
index 43ebca5229..d69d38426a 100644
--- a/mullvad-encrypted-dns-proxy/src/forwarder.rs
+++ b/mullvad-encrypted-dns-proxy/src/forwarder.rs
@@ -7,12 +7,11 @@ use tokio::{
net::TcpStream,
};
-use crate::config::Obfuscator;
+use crate::config::{Obfuscator, ProxyConfig};
/// Forwards local traffic to a proxy endpoint, obfuscating it if the proxy config says so.
///
-/// Obtain [`ProxyConfig`](crate::config::ProxyConfig)s with
-/// [resolve_configs](crate::config_resolver::resolve_configs).
+/// Obtain [`ProxyConfig`](ProxyConfig)s with [resolve_configs](crate::config_resolver::resolve_configs).
pub struct Forwarder<S> {
read_obfuscator: Option<Box<dyn Obfuscator>>,
write_obfuscator: Option<Box<dyn Obfuscator>>,
@@ -24,7 +23,7 @@ where
S: AsyncRead + AsyncWrite + Unpin,
{
/// Create a [`Forwarder`] with a connected `stream` to an encrypted DNS proxy server
- pub fn from_stream(proxy_config: &crate::config::ProxyConfig, stream: S) -> Self {
+ pub fn from_stream(proxy_config: &ProxyConfig, stream: S) -> Self {
let (read_obfuscator, write_obfuscator) =
if let Some(obfuscation_config) = &proxy_config.obfuscation {
(
@@ -46,7 +45,7 @@ where
/// Forward TCP traffic over various proxy configurations.
impl Forwarder<TcpStream> {
/// Create a forwarder that will connect to a given proxy endpoint.
- pub async fn connect(proxy_config: &crate::config::ProxyConfig) -> io::Result<Self> {
+ pub async fn connect(proxy_config: &ProxyConfig) -> io::Result<Self> {
let server_connection = TcpStream::connect(proxy_config.addr).await?;
Ok(Self::from_stream(proxy_config, server_connection))
}