-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
142 additions
and
32 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
ios/MullvadREST/Transport/EncryptedDNS/EncryptedDNSTransport.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// EncryptedDNSTransport.swift | ||
// MullvadVPN | ||
// | ||
// Created by Mojgan on 2024-09-19. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
import Foundation | ||
import MullvadRustRuntime | ||
import MullvadTypes | ||
|
||
public final class EncryptedDNSTransport: RESTTransport { | ||
public var name: String { | ||
"encrypted-dns-url-session" | ||
} | ||
|
||
/// The `URLSession` used to send requests via `encryptedDNSProxy` | ||
public let urlSession: URLSession | ||
|
||
public init( | ||
urlSession: URLSession, | ||
addressCache: REST.AddressCache | ||
) { | ||
self.urlSession = urlSession | ||
} | ||
|
||
public func sendRequest( | ||
_ request: URLRequest, | ||
completion: @escaping (Data?, URLResponse?, (any Error)?) -> Void | ||
) -> any Cancellable { | ||
// TODO: Start proxy once the backend is integrated into the Swift code. | ||
let dataTask = urlSession.dataTask(with: request, completionHandler: completion) | ||
dataTask.resume() | ||
return dataTask | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.