Skip to content

Commit 90febad

Browse files
committed
fixup! Add domain fronting server
1 parent 4de546b commit 90febad

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

mullvad-api/src/proxy.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,22 @@ pub enum ProxyConfig {
7474

7575
impl ProxyConfig {
7676
/// Returns the remote endpoint describing how to reach the proxy.
77-
fn get_endpoint(&self) -> Option<Endpoint> {
77+
fn get_endpoint(&self) -> Endpoint {
7878
match self {
79-
ProxyConfig::Shadowsocks(shadowsocks) => Some(Endpoint::from_socket_address(
80-
shadowsocks.endpoint,
81-
TransportProtocol::Tcp,
82-
)),
83-
ProxyConfig::Socks5Local(local) => Some(local.remote_endpoint),
84-
ProxyConfig::Socks5Remote(remote) => Some(Endpoint::from_socket_address(
85-
remote.endpoint,
86-
TransportProtocol::Tcp,
87-
)),
79+
ProxyConfig::Shadowsocks(shadowsocks) => {
80+
Endpoint::from_socket_address(shadowsocks.endpoint, TransportProtocol::Tcp)
81+
}
82+
ProxyConfig::Socks5Local(local) => local.remote_endpoint,
83+
ProxyConfig::Socks5Remote(remote) => {
84+
Endpoint::from_socket_address(remote.endpoint, TransportProtocol::Tcp)
85+
}
8886
ProxyConfig::EncryptedDnsProxy(proxy) => {
8987
let addr = SocketAddr::V4(proxy.addr);
90-
Some(Endpoint::from_socket_address(addr, TransportProtocol::Tcp))
88+
Endpoint::from_socket_address(addr, TransportProtocol::Tcp)
89+
}
90+
ProxyConfig::DomainFronting(proxy) => {
91+
Endpoint::from_socket_address(proxy.addr, TransportProtocol::Tcp)
9192
}
92-
ProxyConfig::DomainFronting(proxy) => Some(Endpoint::from_socket_address(
93-
proxy.addr,
94-
TransportProtocol::Tcp,
95-
)),
9693
}
9794
}
9895
}
@@ -178,7 +175,7 @@ impl ApiConnectionMode {
178175
pub fn get_endpoint(&self) -> Option<Endpoint> {
179176
match self {
180177
ApiConnectionMode::Direct => None,
181-
ApiConnectionMode::Proxied(proxy_config) => proxy_config.get_endpoint(),
178+
ApiConnectionMode::Proxied(proxy_config) => Some(proxy_config.get_endpoint()),
182179
}
183180
}
184181

0 commit comments

Comments
 (0)