Created
March 4, 2020 14:25
-
-
Save OliverLetterer/b0e06abc57307d372a412c16cc8c2090 to your computer and use it in GitHub Desktop.
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
import Alamofire | |
let configuration = URLSessionConfiguration.default | |
configuration.requestCachePolicy = URLRequest.CachePolicy.reloadIgnoringLocalCacheData | |
let proxyConfiguration: [AnyHashable : Any] = [ | |
kCFNetworkProxiesHTTPEnable as AnyHashable: true, | |
kCFNetworkProxiesHTTPProxy as AnyHashable: host, | |
kCFNetworkProxiesHTTPPort as AnyHashable: port, | |
kCFStreamPropertyHTTPSProxyHost as AnyHashable: host, | |
kCFStreamPropertyHTTPSProxyPort as AnyHashable: port, | |
kCFProxyUsernameKey as AnyHashable: username, | |
kCFProxyPasswordKey as AnyHashable: password, | |
] | |
configuration.httpAdditionalHeaders = [ | |
"Proxy-Authorization": HTTPHeader.authorization(username: username, password: password).value | |
] | |
configuration.connectionProxyDictionary = proxyConfiguration |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment