Updated readm, bumped pod version to 0.2.0

This commit is contained in:
Mikhail Churbanov 2018-06-12 18:05:28 +03:00
parent 7e4ef08211
commit a752ac83b7
3 changed files with 45 additions and 32 deletions

View File

@ -2,25 +2,25 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'ProxyResolver'
s.version = '0.1.0'
s.version = '0.2.0'
s.summary = 'Simple resolution of user proxy settings for macOS'
# This description is used to generate tags and improve search results.

View File

@ -18,14 +18,18 @@ let proxy = ProxyResolver()
let url = URL(string: "https://github.com")!
proxy.resolve(for: url) { result in
switch result {
case .success(let proxy):
guard let proxy = proxy else {
// no proxy required
}
case .direct:
// Direct connection allowed - no proxy required
break
case .proxy(let proxy):
// here you can establish connection to proxy or whatever you want
// print ("For \(url) use \(proxy.host):\(proxy.port)")
case .failure(let error):
// proxy.type - one of ProxyType enum: .http, .https or .socks
// proxy.host - host name of proxy to use
// proxy.port - port number
break
case .error(let error):
// Handle error
break
}
}
```
@ -35,17 +39,26 @@ let url = URL(string: "https://github.com")!
#### Supported system configurations
- [x] Auto Proxy Discovery*
- [x] Automatic Proxy Configuration URL*
- [x] Web Proxy
- [x] Socks
- [x] Web Proxy (HTTP)
- [x] Secure Web Proxy (HTTPS)
- [x] SOCKS Proxy
- [ ] ~~FTP Proxy~~
- [ ] ~~Streaming Proxy (RTSP)~~
- [ ] ~~Gopher Proxy~~
> \* due to ATS protection auto-configuration url should be HTTPS or have \*.local or unresolvable globally domain with `NSAllowsLocalNetworking` key configured in plist. More info could be found in [NSAppTransportSecurity reference](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33).
> \* due to ATS protection auto-configuration url should be HTTPS or have \*.local or unresolvable globally domain, otherwise you will need to set the `NSAllowsLocalNetworking` key in plist. More info could be found in [NSAppTransportSecurity reference](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33).
#### Other (TBD)
- Proxy with required password support
- [x] Proxy with required password support
> `Proxy.credentials` will automatically access `Proxy` keychain to retrieve configured for proxy account and password. As it would require permission from user the credentials are retrieved lazily only when you try to get them.
- [x] Configurable
> You can use custom proxy configuration provider instead of system one, or provide your own fetcher for downloading auto-configuration scripts instead of default one based on NSURLSession.
- [ ] [In Progress] Aligned with Apple recommendations
> In general, you should try to download a URL using the first proxy in the array, try the second proxy if the first one fails, and so on.
## Requirements
- Swift: 4+
- macOS: 10.10+