From cb24d2c766d096b4adff982ab4c9355277f7596c Mon Sep 17 00:00:00 2001 From: Mikhail Churbanov Date: Thu, 31 May 2018 23:29:01 +0300 Subject: [PATCH] Updated readme, fixed pod lint warnings --- .swift-version | 1 + ProxyResolver.podspec | 6 ++++-- README.md | 45 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 .swift-version diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..7d5c902 --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +4.1 diff --git a/ProxyResolver.podspec b/ProxyResolver.podspec index 70e2165..20ed369 100644 --- a/ProxyResolver.podspec +++ b/ProxyResolver.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = 'ProxyResolver' s.version = '0.1.0' - s.summary = 'A short description of ProxyResolver.' + s.summary = 'Simple resolution of user proxy settings for macOS' # This description is used to generate tags and improve search results. # * Think: What does it do? Why did you write it? What is the focus? @@ -18,7 +18,9 @@ Pod::Spec.new do |s| # * Finally, don't worry about the indent, CocoaPods strips it! s.description = <<-DESC -TODO: Add long description of the pod here. + ProxyResolver allows simply resolve the actual proxy information from users + system configuration and could be used for setting up Stream-based connections, + for example for Web Sockets. DESC s.homepage = 'https://github.com/rinold/ProxyResolver' diff --git a/README.md b/README.md index 0bd5b07..41dfc93 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,50 @@ [![License](https://img.shields.io/cocoapods/l/ProxyResolver.svg?style=flat)](https://cocoapods.org/pods/ProxyResolver) [![Platform](https://img.shields.io/cocoapods/p/ProxyResolver.svg?style=flat)](https://cocoapods.org/pods/ProxyResolver) -## Example +ProxyResolver allows simply resolve the actual proxy information from users +system configuration and could be used for setting up Stream-based connections, +for example for Web Sockets. -To run the example project, clone the repo, and run `pod install` from the Example directory first. +Usage example: + +```swift +import ProxyResolver + +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 + } + // here you can establish connection to proxy or whatever you want + // print ("For \(url) use \(proxy.host):\(proxy.port)") + case .failure(let error): + // Handle error + } +} +``` + +## Features + +#### Supported system configurations +- [x] Auto Proxy Discovery* +- [x] Automatic Proxy Configuration URL* +- [x] Web Proxy +- [x] Socks + +> \* 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). + + +#### Other (TBD) +- 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. ## Requirements +- Swift: 4.0+ +- macOS: 10.0+ ## Installation @@ -22,6 +61,8 @@ pod 'ProxyResolver' ## Author +ProxyResolver was initially inspired by the Starscream proxy support merge request. + rinold, mihail.churbanov@gmail.com ## License