├── Cartfile ├── Cartfile.resolved ├── .gitmodules ├── Soxy.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── Soxy.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Podfile ├── SoxyExampleMacOs ├── example.entitlements ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist └── Base.lproj │ └── Main.storyboard ├── Soxy ├── GCDAsyncSocketExtensions.swift ├── Soxy.swift ├── Server.swift └── Connection.swift ├── SoxyTests ├── Info.plist └── Soxy1Tests.swift ├── Soxy1 └── Info.plist └── .gitignore /Cartfile: -------------------------------------------------------------------------------- 1 | github "robbiehanson/CocoaAsyncSocket" 2 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "robbiehanson/CocoaAsyncSocket" "7.5.0" 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Carthage/Checkouts/CocoaAsyncSocket"] 2 | path = Carthage/Checkouts/CocoaAsyncSocket 3 | url = https://github.com/robbiehanson/CocoaAsyncSocket.git 4 | -------------------------------------------------------------------------------- /Soxy.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Soxy.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Soxy.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'Soxy' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for Soxy 9 | pod 'CocoaAsyncSocket' 10 | 11 | target 'SoxyExampleMacOs' do 12 | inherit! :search_paths 13 | end 14 | 15 | end -------------------------------------------------------------------------------- /SoxyExampleMacOs/example.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Soxy/GCDAsyncSocketExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GCDAsyncSocketExtensions.swift 3 | // Soxy 4 | // 5 | // Created by Luo Sheng on 17/08/2016. 6 | // Copyright © 2016 Pop Tap. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CocoaAsyncSocket 11 | 12 | extension GCDAsyncSocket { 13 | func writeData(_ t: T) where T: DataConvertible, T: Taggable { 14 | if let data = t.data { 15 | self.write(data, withTimeout: -1, tag: t.tag) 16 | } 17 | } 18 | 19 | func readData(_ t: T) where T: Taggable { 20 | self.readData(withTimeout: -1, tag: t.tag) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SoxyTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Soxy1/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2019 Pop Tap. All rights reserved. 23 | 24 | 25 | -------------------------------------------------------------------------------- /Soxy/Soxy.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SoxProxy.swift 3 | // SoxProxy 4 | // 5 | // Created by Luo Sheng on 15/10/3. 6 | // Copyright © 2015年 Pop Tap. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CocoaAsyncSocket 11 | import NetworkExtension 12 | 13 | struct Soxy { 14 | struct SOCKS { 15 | static let version: UInt8 = 5 16 | static let reserved: UInt8 = 0 17 | } 18 | } 19 | 20 | extension UInt16 { 21 | func toByteArray() -> [UInt8] { 22 | return [UInt8(self >> 8 & 0x00FF), UInt8(self & 0x00FF)] 23 | } 24 | } 25 | 26 | protocol DataConvertible { 27 | init(data: Data) throws 28 | var data: Data? { get } 29 | } 30 | 31 | protocol Taggable { 32 | var tag: Int { get } 33 | } 34 | 35 | protocol Proxyable { 36 | var proxyServer: NEProxyServer? { get } 37 | } 38 | 39 | extension Taggable { 40 | var tag: Int { 41 | get { 42 | return 0 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /SoxyExampleMacOs/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // S5 4 | // 5 | // Created by Luo Sheng on 15/10/1. 6 | // Copyright © 2015年 Pop Tap. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import NetworkExtension 11 | import Soxy 12 | 13 | @NSApplicationMain 14 | class AppDelegate: NSObject, NSApplicationDelegate { 15 | 16 | @IBOutlet weak var window: NSWindow! 17 | 18 | let server: Server 19 | 20 | override init() { 21 | server = try! Server(port: 8080) 22 | server.proxyServer = NEProxyServer(address: "127.0.0.1", port: 1080) 23 | print(server.host.description, server.port.description) 24 | super.init() 25 | } 26 | 27 | func applicationDidFinishLaunching(_ aNotification: Notification) { 28 | // Insert code here to initialize your application 29 | } 30 | 31 | func applicationWillTerminate(_ aNotification: Notification) { 32 | // Insert code here to tear down your application 33 | } 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /SoxyTests/Soxy1Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Soxy1Tests.swift 3 | // Soxy1Tests 4 | // 5 | // Created by Zac.Gorak on 6/12/19. 6 | // Copyright © 2019 Pop Tap. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Soxy1 11 | 12 | class Soxy1Tests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/swift 2 | 3 | ### Swift ### 4 | # Xcode 5 | # 6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 7 | 8 | ## Build generated 9 | build/ 10 | DerivedData 11 | 12 | ## Various settings 13 | *.pbxuser 14 | !default.pbxuser 15 | *.mode1v3 16 | !default.mode1v3 17 | *.mode2v3 18 | !default.mode2v3 19 | *.perspectivev3 20 | !default.perspectivev3 21 | xcuserdata 22 | 23 | ## Other 24 | *.xccheckout 25 | *.moved-aside 26 | *.xcuserstate 27 | *.xcscmblueprint 28 | 29 | ## Obj-C/Swift specific 30 | *.hmap 31 | *.ipa 32 | 33 | # CocoaPods 34 | # 35 | # We recommend against adding the Pods directory to your .gitignore. However 36 | # you should judge for yourself, the pros and cons are mentioned at: 37 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 38 | # 39 | # Pods/ 40 | 41 | # Carthage 42 | # 43 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 44 | # Carthage/Checkouts 45 | 46 | Carthage/Build 47 | 48 | -------------------------------------------------------------------------------- /SoxyExampleMacOs/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /SoxyExampleMacOs/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015年 Pop Tap. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Soxy/Server.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Server.swift 3 | // SoxProxy 4 | // 5 | // Created by Luo Sheng on 15/10/3. 6 | // Copyright © 2015年 Pop Tap. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CocoaAsyncSocket 11 | import NetworkExtension 12 | 13 | open class Server: NSObject, GCDAsyncSocketDelegate, ConnectionDelegate, Proxyable { 14 | 15 | fileprivate let socket: GCDAsyncSocket 16 | fileprivate var connections = Set() 17 | public var proxyServer: NEProxyServer? 18 | 19 | open var host: String! { 20 | get { 21 | return socket.localHost 22 | } 23 | } 24 | 25 | open var port: UInt16 { 26 | get { 27 | return socket.localPort 28 | } 29 | } 30 | 31 | public init(port: UInt16) throws { 32 | socket = GCDAsyncSocket(delegate: nil, delegateQueue: DispatchQueue.global(qos: .utility)) 33 | super.init() 34 | socket.delegate = self 35 | try socket.accept(onPort: port) 36 | } 37 | 38 | deinit { 39 | disconnectAll() 40 | } 41 | 42 | func disconnectAll() { 43 | connections.forEach { $0.disconnect() } 44 | } 45 | 46 | // MARK: - GCDAsyncSocketDelegate 47 | 48 | @objc open func socket(_ sock: GCDAsyncSocket, didAcceptNewSocket newSocket: GCDAsyncSocket) { 49 | let connection = Connection(socket: newSocket) 50 | connection.delegate = self 51 | connection.server = self 52 | connections.insert(connection) 53 | } 54 | 55 | // MARK: - SOCKSConnectionDelegate 56 | 57 | func connectionDidClose(_ connection: Connection) { 58 | connections.remove(connection) 59 | } 60 | } 61 | 62 | 63 | -------------------------------------------------------------------------------- /Soxy/Connection.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SOCKSServer.swift 3 | // S5 4 | // 5 | // Created by Luo Sheng on 15/10/1. 6 | // Copyright © 2015年 Pop Tap. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CocoaAsyncSocket 11 | import NetworkExtension 12 | 13 | // MARK: - 14 | 15 | protocol ConnectionDelegate { 16 | func connectionDidClose(_ connection: Connection) 17 | } 18 | 19 | // MARK: - 20 | 21 | open class Connection: NSObject, GCDAsyncSocketDelegate { 22 | 23 | static let replyTag = 100 24 | 25 | enum Phase: Int, Taggable { 26 | case methodSelection = 10 27 | case methodSelectionReply 28 | case request 29 | case requestReply 30 | 31 | var tag: Int { 32 | get { 33 | return self.rawValue 34 | } 35 | } 36 | } 37 | 38 | /* 39 | +----+----------+----------+ 40 | |VER | NMETHODS | METHODS | 41 | +----+----------+----------+ 42 | | 1 | 1 | 1 to 255 | 43 | +----+----------+----------+ 44 | */ 45 | struct MethodSelection: DataConvertible, Taggable { 46 | let numberOfAuthenticationMethods: UInt8 47 | let authenticationMethods: [AuthenticationMethod] 48 | 49 | init(data: Data) throws { 50 | var bytes: [UInt8] = [UInt8](repeating: 0, count: data.count) 51 | (data as NSData).getBytes(&bytes, length: bytes.count) 52 | 53 | guard bytes.count >= 3 else { 54 | throw SocketError.wrongNumberOfAuthenticationMethods 55 | } 56 | 57 | guard bytes[0] == Soxy.SOCKS.version else { 58 | throw SocketError.invalidSOCKSVersion 59 | } 60 | 61 | numberOfAuthenticationMethods = bytes[1] 62 | 63 | guard bytes.count == 1 + 1 + Int(numberOfAuthenticationMethods) else { 64 | throw SocketError.wrongNumberOfAuthenticationMethods 65 | } 66 | 67 | authenticationMethods = try bytes[2...(bytes.count - 1)].map() { 68 | guard let method = AuthenticationMethod(rawValue: $0) else { 69 | throw SocketError.notSupportedAuthenticationMethod 70 | } 71 | return method 72 | } 73 | } 74 | 75 | var data: Data? { 76 | get { 77 | var bytes = [UInt8]() 78 | 79 | bytes.append(Soxy.SOCKS.version) 80 | bytes.append(numberOfAuthenticationMethods) 81 | bytes.append(contentsOf: authenticationMethods.map() { $0.rawValue }) 82 | 83 | let data = Data(bytes) 84 | return data 85 | } 86 | } 87 | } 88 | 89 | /* 90 | +----+--------+ 91 | |VER | METHOD | 92 | +----+--------+ 93 | | 1 | 1 | 94 | +----+--------+ 95 | */ 96 | struct MethodSelectionReply: DataConvertible, Taggable { 97 | let method: AuthenticationMethod 98 | 99 | init(data: Data) throws { 100 | throw SocketError.notImplemented 101 | } 102 | 103 | init(method: AuthenticationMethod) { 104 | self.method = method 105 | } 106 | 107 | var data: Data? { 108 | get { 109 | let bytes = [Soxy.SOCKS.version, method.rawValue] 110 | return Data(bytes) 111 | } 112 | } 113 | } 114 | 115 | /* 116 | +----+-----+-------+------+----------+----------+ 117 | |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | 118 | +----+-----+-------+------+----------+----------+ 119 | | 1 | 1 | X'00' | 1 | Variable | 2 | 120 | +----+-----+-------+------+----------+----------+ 121 | 122 | o VER protocol version: X'05' 123 | o CMD 124 | o CONNECT X'01' 125 | o BIND X'02' 126 | o UDP ASSOCIATE X'03' 127 | o RSV RESERVED 128 | o ATYP address type of following address 129 | o IP V4 address: X'01' 130 | o DOMAINNAME: X'03' 131 | o IP V6 address: X'04' 132 | o DST.ADDR desired destination address 133 | o DST.PORT desired destination port in network octet order 134 | */ 135 | struct Request: DataConvertible, Taggable { 136 | enum Command: UInt8 { 137 | case connect = 0x01 138 | case bind 139 | case udpAssociate 140 | } 141 | 142 | let command: Command 143 | let addressType: AddressType 144 | let targetHost: String 145 | let targetPort: UInt16 146 | 147 | init(data: Data) throws { 148 | var bytes = [UInt8](repeating: 0, count: data.count) 149 | (data as NSData).getBytes(&bytes, length: bytes.count) 150 | 151 | var offset = 0 152 | 153 | guard bytes[offset] == Soxy.SOCKS.version else { 154 | throw SocketError.invalidSOCKSVersion 155 | } 156 | offset += 1 157 | 158 | guard let cmd = Command(rawValue: bytes[offset]) else { 159 | throw SocketError.invalidRequestCommand 160 | } 161 | offset += 1 162 | command = cmd 163 | 164 | // Reserved 165 | _ = bytes[offset] 166 | offset += 1 167 | 168 | guard let atyp = AddressType(rawValue: bytes[offset]) else { 169 | throw SocketError.invalidAddressType 170 | } 171 | offset += 1 172 | addressType = atyp 173 | 174 | switch addressType { 175 | case .domainName: 176 | let domainNameLength = bytes[offset] 177 | offset += 1 178 | guard let domainName = String(bytes: bytes[offset..<(offset + Int(domainNameLength))], encoding: String.Encoding.ascii) else { 179 | throw SocketError.invalidDomainName 180 | } 181 | targetHost = domainName 182 | offset += Int(domainNameLength) 183 | break 184 | default: 185 | targetHost = "" 186 | break 187 | } 188 | 189 | var bindPort: UInt16 = 0 190 | (data as NSData).getBytes(&bindPort, range: NSRange(location: offset, length: 2)) 191 | targetPort = bindPort.bigEndian 192 | } 193 | 194 | var data: Data? { 195 | get { 196 | var bytes: [UInt8] = [Soxy.SOCKS.version, command.rawValue, Soxy.SOCKS.reserved, addressType.rawValue] 197 | 198 | switch addressType { 199 | case .domainName: 200 | bytes.append(UInt8(targetHost.count)) 201 | bytes.append(contentsOf: [UInt8](targetHost.utf8)) 202 | break 203 | default: 204 | break 205 | } 206 | 207 | let bindPort = targetPort.littleEndian.byteSwapped 208 | bytes.append(contentsOf: bindPort.toByteArray()) 209 | 210 | return Data(bytes) 211 | } 212 | } 213 | } 214 | 215 | /* 216 | o X'00' NO AUTHENTICATION REQUIRED 217 | o X'01' GSSAPI 218 | o X'02' USERNAME/PASSWORD 219 | o X'03' to X'7F' IANA ASSIGNED 220 | o X'80' to X'FE' RESERVED FOR PRIVATE METHODS 221 | o X'FF' NO ACCEPTABLE METHODS 222 | */ 223 | enum AuthenticationMethod: UInt8 { 224 | case 225 | none = 0x00, 226 | gssapi, 227 | usernamePassword 228 | } 229 | 230 | enum AddressType: UInt8 { 231 | case ipv4 = 0x01 232 | case ipv6 = 0x04 233 | case domainName = 0x03 234 | } 235 | 236 | enum SocketError: Error { 237 | case invalidSOCKSVersion 238 | case unableToRetrieveNumberOfAuthenticationMethods 239 | case notSupportedAuthenticationMethod 240 | case supportedAuthenticationMethodNotFound 241 | case wrongNumberOfAuthenticationMethods 242 | case invalidRequestCommand 243 | case invalidHeaderFragment 244 | case invalidAddressType 245 | case invalidDomainLength 246 | case invalidDomainName 247 | case invalidPort 248 | case notImplemented 249 | } 250 | 251 | /* 252 | +----+-----+-------+------+----------+----------+ 253 | |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | 254 | +----+-----+-------+------+----------+----------+ 255 | | 1 | 1 | X'00' | 1 | Variable | 2 | 256 | +----+-----+-------+------+----------+----------+ 257 | */ 258 | struct Reply: DataConvertible, Taggable { 259 | enum Field: UInt8 { 260 | case succeed = 0x00 261 | case generalSOCKSServerFailure 262 | case connectionNotAllowedByRuleset 263 | case networkUnreachable 264 | case connectionRefused 265 | case ttlExpired 266 | case commandNotSupported 267 | case addressTypeNotSupported 268 | } 269 | let field: Field 270 | let addressType: AddressType 271 | let address: String 272 | let port: UInt16 273 | 274 | init(data: Data) throws { 275 | throw SocketError.notImplemented 276 | } 277 | 278 | init(field: Field, addressType: AddressType, address: String, port: UInt16) { 279 | self.field = field 280 | self.addressType = addressType 281 | self.address = address 282 | self.port = port 283 | } 284 | 285 | var data: Data? { 286 | get { 287 | var bytes: [UInt8] = [Soxy.SOCKS.version, field.rawValue, Soxy.SOCKS.reserved] 288 | 289 | // If reply field is anything other than Succeed, just reply with 290 | // VER, REP, RSV 291 | guard field == .succeed else { 292 | return Data(bytes) 293 | } 294 | 295 | bytes.append(addressType.rawValue) 296 | 297 | switch addressType { 298 | case .domainName: 299 | bytes.append(UInt8(address.count)) 300 | bytes.append(contentsOf: [UInt8](address.utf8)) 301 | break 302 | default: 303 | break 304 | } 305 | 306 | bytes.append(contentsOf: port.littleEndian.toByteArray()) 307 | let data = NSMutableData(bytes: bytes, length: bytes.count) 308 | var networkOctetOrderPort: UInt16 = port.littleEndian 309 | data.append(&networkOctetOrderPort, length: 2) 310 | return data as Data 311 | } 312 | } 313 | 314 | var tag: Int { 315 | get { 316 | switch field { 317 | case .succeed: 318 | return Connection.replyTag 319 | default: 320 | return 0 321 | } 322 | } 323 | } 324 | } 325 | 326 | var delegate: ConnectionDelegate? 327 | var server: Proxyable? 328 | fileprivate let delegateQueue: DispatchQueue 329 | fileprivate let clientSocket: GCDAsyncSocket 330 | fileprivate var directSocket: GCDAsyncSocket? 331 | fileprivate var methodSelection: MethodSelection? 332 | fileprivate var request: Request? 333 | fileprivate var proxySocket: GCDAsyncSocket? 334 | 335 | override open var hash: Int { 336 | get { 337 | return ObjectIdentifier(self).hashValue 338 | } 339 | } 340 | 341 | public static func ==(lhs: Connection, rhs: Connection) -> Bool { 342 | return ObjectIdentifier(lhs) == ObjectIdentifier(rhs) 343 | } 344 | 345 | init(socket: GCDAsyncSocket) { 346 | clientSocket = socket 347 | delegateQueue = DispatchQueue(label: "net.luosheng.SOCKSConnection.DelegateQueue", attributes: []) 348 | super.init() 349 | clientSocket.setDelegate(self, delegateQueue: delegateQueue) 350 | clientSocket.readData(Phase.methodSelection) 351 | } 352 | 353 | func disconnect() { 354 | clientSocket.disconnectAfterReadingAndWriting() 355 | directSocket?.disconnectAfterReadingAndWriting() 356 | proxySocket?.disconnectAfterReadingAndWriting() 357 | } 358 | 359 | // MARK: - Private methods 360 | 361 | fileprivate func processMethodSelection(_ data: Data) throws { 362 | let methodSelection = try MethodSelection(data: data) 363 | guard methodSelection.authenticationMethods.contains(.none) else { 364 | throw SocketError.supportedAuthenticationMethodNotFound 365 | } 366 | self.methodSelection = methodSelection 367 | let reply = MethodSelectionReply(method: .none) 368 | clientSocket.writeData(reply) 369 | clientSocket.readData(Phase.request) 370 | } 371 | 372 | fileprivate func processRequest(_ data: Data) throws { 373 | let request = try Request(data: data) 374 | let reply = Reply(field: .succeed, addressType: request.addressType, address: request.targetHost, port: request.targetPort) 375 | self.request = request 376 | clientSocket.writeData(reply) 377 | clientSocket.readData(withTimeout: -1, tag: 0) 378 | } 379 | 380 | // MARK: - GCDAsyncSocketDelegate 381 | 382 | @objc open func socketDidDisconnect(_ sock: GCDAsyncSocket, withError err: Error?) { 383 | disconnect() 384 | delegate?.connectionDidClose(self) 385 | } 386 | 387 | @objc open func socket(_ sock: GCDAsyncSocket, didRead data: Data, withTag tag: Int) { 388 | do { 389 | guard let phase = Phase(rawValue: tag) else { 390 | // If the tag is not specified, it's in proxy mode 391 | if sock == clientSocket { 392 | if server?.proxyServer != nil { 393 | proxySocket?.write(data, withTimeout: -1, tag: 0) 394 | } else { 395 | directSocket?.write(data, withTimeout: -1, tag: 0) 396 | } 397 | } else { 398 | clientSocket.write(data, withTimeout: -1, tag: 0) 399 | } 400 | sock.readData(withTimeout: -1, tag: 0) 401 | return 402 | } 403 | switch phase { 404 | case .methodSelection: 405 | try self.processMethodSelection(data) 406 | break 407 | case .request: 408 | try self.processRequest(data) 409 | break 410 | case .methodSelectionReply: 411 | if let request = request { 412 | proxySocket?.writeData(request) 413 | proxySocket?.readData(Phase.requestReply) 414 | } 415 | break 416 | case .requestReply: 417 | clientSocket.readData(withTimeout: -1, tag: 0) 418 | proxySocket?.readData(withTimeout: -1, tag: 0) 419 | break 420 | } 421 | } catch { 422 | print("error: \(error)") 423 | self.disconnect() 424 | } 425 | } 426 | 427 | @objc open func socket(_ sock: GCDAsyncSocket, didWriteDataWithTag tag: Int) { 428 | if tag == Connection.replyTag { 429 | 430 | if let proxyServer = server?.proxyServer { 431 | proxySocket = GCDAsyncSocket(delegate: self, delegateQueue: delegateQueue) 432 | try! proxySocket?.connect(toHost: proxyServer.address, onPort: UInt16(proxyServer.port)) 433 | if let methodSelection = methodSelection { 434 | proxySocket?.writeData(methodSelection) 435 | proxySocket?.readData(Phase.methodSelectionReply) 436 | } 437 | } else { 438 | directSocket = GCDAsyncSocket(delegate: self, delegateQueue: delegateQueue) 439 | guard let request = request else { 440 | return 441 | } 442 | do { 443 | try directSocket?.connect(toHost: request.targetHost, onPort: request.targetPort, withTimeout: -1) 444 | clientSocket.readData(withTimeout: -1, tag: 0) 445 | directSocket?.readData(withTimeout: -1, tag: 0) 446 | } catch { 447 | clientSocket.disconnectAfterReadingAndWriting() 448 | } 449 | } 450 | } 451 | } 452 | } 453 | -------------------------------------------------------------------------------- /Soxy.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 975748430ADB559F1AA7B294 /* Pods_Soxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24292743C19C7BD004EC6D0B /* Pods_Soxy.framework */; }; 11 | AC2152CB22B1373A006E8DF2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AC2152C922B1373A006E8DF2 /* Main.storyboard */; }; 12 | AC2152ED22B1373F006E8DF2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B322009F1BBCAB23009829BD /* AppDelegate.swift */; }; 13 | AC2152EE22B13742006E8DF2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B32200A11BBCAB23009829BD /* Assets.xcassets */; }; 14 | AC21531922B142F3006E8DF2 /* Soxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC21531022B142F3006E8DF2 /* Soxy.framework */; }; 15 | AC21532022B142F3006E8DF2 /* Soxy1Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC21531F22B142F3006E8DF2 /* Soxy1Tests.swift */; }; 16 | AC21532522B142F3006E8DF2 /* Soxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC21531022B142F3006E8DF2 /* Soxy.framework */; }; 17 | AC21532622B142F3006E8DF2 /* Soxy.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AC21531022B142F3006E8DF2 /* Soxy.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | AC21532E22B14306006E8DF2 /* Soxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B33C53C91BBFBE1300231FCE /* Soxy.swift */; }; 19 | AC21532F22B1430A006E8DF2 /* Server.swift in Sources */ = {isa = PBXBuildFile; fileRef = B33C53C61BBFBC3600231FCE /* Server.swift */; }; 20 | AC21533022B1430D006E8DF2 /* Connection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32200B21BBCAFA1009829BD /* Connection.swift */; }; 21 | AC21533122B1430F006E8DF2 /* GCDAsyncSocketExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B32B81E11D63D72A00076C52 /* GCDAsyncSocketExtensions.swift */; }; 22 | B335CB5544943C1ECE885A71 /* Pods_SoxyExampleMacOs.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B2D73D4B648DFCEE801A057 /* Pods_SoxyExampleMacOs.framework */; }; 23 | /* End PBXBuildFile section */ 24 | 25 | /* Begin PBXContainerItemProxy section */ 26 | AC21531A22B142F3006E8DF2 /* PBXContainerItemProxy */ = { 27 | isa = PBXContainerItemProxy; 28 | containerPortal = B32200941BBCAB23009829BD /* Project object */; 29 | proxyType = 1; 30 | remoteGlobalIDString = AC21530F22B142F3006E8DF2; 31 | remoteInfo = Soxy1; 32 | }; 33 | AC21531C22B142F3006E8DF2 /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = B32200941BBCAB23009829BD /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = AC2152C022B13736006E8DF2; 38 | remoteInfo = SoxyExampleMacOs; 39 | }; 40 | AC21532322B142F3006E8DF2 /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = B32200941BBCAB23009829BD /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = AC21530F22B142F3006E8DF2; 45 | remoteInfo = Soxy1; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXCopyFilesBuildPhase section */ 50 | AC21532A22B142F3006E8DF2 /* Embed Frameworks */ = { 51 | isa = PBXCopyFilesBuildPhase; 52 | buildActionMask = 2147483647; 53 | dstPath = ""; 54 | dstSubfolderSpec = 10; 55 | files = ( 56 | AC21532622B142F3006E8DF2 /* Soxy.framework in Embed Frameworks */, 57 | ); 58 | name = "Embed Frameworks"; 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXCopyFilesBuildPhase section */ 62 | 63 | /* Begin PBXFileReference section */ 64 | 1B2D73D4B648DFCEE801A057 /* Pods_SoxyExampleMacOs.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SoxyExampleMacOs.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65 | 24292743C19C7BD004EC6D0B /* Pods_Soxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Soxy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 53F7C18F086E45EAB8D5161B /* Pods-SoxyExampleMacOs.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SoxyExampleMacOs.release.xcconfig"; path = "Target Support Files/Pods-SoxyExampleMacOs/Pods-SoxyExampleMacOs.release.xcconfig"; sourceTree = ""; }; 67 | 8FB09830B9DCDE8DB9E4CA00 /* Pods-Soxy.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Soxy.release.xcconfig"; path = "Target Support Files/Pods-Soxy/Pods-Soxy.release.xcconfig"; sourceTree = ""; }; 68 | 93C6557D799AA793C92D4F5A /* Pods-Soxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Soxy.debug.xcconfig"; path = "Target Support Files/Pods-Soxy/Pods-Soxy.debug.xcconfig"; sourceTree = ""; }; 69 | AC2152C122B13736006E8DF2 /* SoxyExampleMacOs.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SoxyExampleMacOs.app; sourceTree = BUILT_PRODUCTS_DIR; }; 70 | AC2152CA22B1373A006E8DF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 71 | AC2152CD22B1373A006E8DF2 /* example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = example.entitlements; sourceTree = ""; }; 72 | AC21531022B142F3006E8DF2 /* Soxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Soxy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | AC21531322B142F3006E8DF2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Soxy1/Info.plist; sourceTree = SOURCE_ROOT; }; 74 | AC21531822B142F3006E8DF2 /* SoxyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SoxyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 75 | AC21531F22B142F3006E8DF2 /* Soxy1Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Soxy1Tests.swift; sourceTree = ""; }; 76 | AC21532122B142F3006E8DF2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 77 | B322009F1BBCAB23009829BD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 78 | B32200A11BBCAB23009829BD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 79 | B32200A61BBCAB23009829BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 80 | B32200AE1BBCAF06009829BD /* CocoaAsyncSocket.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaAsyncSocket.framework; path = Carthage/Build/Mac/CocoaAsyncSocket.framework; sourceTree = ""; }; 81 | B32200B21BBCAFA1009829BD /* Connection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Connection.swift; sourceTree = ""; }; 82 | B32B81E11D63D72A00076C52 /* GCDAsyncSocketExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GCDAsyncSocketExtensions.swift; sourceTree = ""; }; 83 | B33C53C61BBFBC3600231FCE /* Server.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Server.swift; sourceTree = ""; }; 84 | B33C53C91BBFBE1300231FCE /* Soxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Soxy.swift; sourceTree = ""; }; 85 | D40822025CADBF53E9F43791 /* Pods-SoxyExampleMacOs.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SoxyExampleMacOs.debug.xcconfig"; path = "Target Support Files/Pods-SoxyExampleMacOs/Pods-SoxyExampleMacOs.debug.xcconfig"; sourceTree = ""; }; 86 | /* End PBXFileReference section */ 87 | 88 | /* Begin PBXFrameworksBuildPhase section */ 89 | AC2152BE22B13736006E8DF2 /* Frameworks */ = { 90 | isa = PBXFrameworksBuildPhase; 91 | buildActionMask = 2147483647; 92 | files = ( 93 | B335CB5544943C1ECE885A71 /* Pods_SoxyExampleMacOs.framework in Frameworks */, 94 | AC21532522B142F3006E8DF2 /* Soxy.framework in Frameworks */, 95 | ); 96 | runOnlyForDeploymentPostprocessing = 0; 97 | }; 98 | AC21530D22B142F3006E8DF2 /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | 975748430ADB559F1AA7B294 /* Pods_Soxy.framework in Frameworks */, 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | AC21531522B142F3006E8DF2 /* Frameworks */ = { 107 | isa = PBXFrameworksBuildPhase; 108 | buildActionMask = 2147483647; 109 | files = ( 110 | AC21531922B142F3006E8DF2 /* Soxy.framework in Frameworks */, 111 | ); 112 | runOnlyForDeploymentPostprocessing = 0; 113 | }; 114 | /* End PBXFrameworksBuildPhase section */ 115 | 116 | /* Begin PBXGroup section */ 117 | 20B9B6B60C5F3E789D88A06B /* Pods */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 93C6557D799AA793C92D4F5A /* Pods-Soxy.debug.xcconfig */, 121 | 8FB09830B9DCDE8DB9E4CA00 /* Pods-Soxy.release.xcconfig */, 122 | D40822025CADBF53E9F43791 /* Pods-SoxyExampleMacOs.debug.xcconfig */, 123 | 53F7C18F086E45EAB8D5161B /* Pods-SoxyExampleMacOs.release.xcconfig */, 124 | ); 125 | path = Pods; 126 | sourceTree = ""; 127 | }; 128 | AC2152BC22B136D8006E8DF2 /* SoxyExampleMacOs */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | B322009F1BBCAB23009829BD /* AppDelegate.swift */, 132 | B32200A11BBCAB23009829BD /* Assets.xcassets */, 133 | AC2152C922B1373A006E8DF2 /* Main.storyboard */, 134 | AC2152CD22B1373A006E8DF2 /* example.entitlements */, 135 | B32200A61BBCAB23009829BD /* Info.plist */, 136 | ); 137 | path = SoxyExampleMacOs; 138 | sourceTree = ""; 139 | }; 140 | AC21531E22B142F3006E8DF2 /* SoxyTests */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | AC21531F22B142F3006E8DF2 /* Soxy1Tests.swift */, 144 | AC21532122B142F3006E8DF2 /* Info.plist */, 145 | ); 146 | path = SoxyTests; 147 | sourceTree = ""; 148 | }; 149 | B32200931BBCAB23009829BD = { 150 | isa = PBXGroup; 151 | children = ( 152 | AC2152BC22B136D8006E8DF2 /* SoxyExampleMacOs */, 153 | B32200AE1BBCAF06009829BD /* CocoaAsyncSocket.framework */, 154 | B322009E1BBCAB23009829BD /* Soxy */, 155 | AC21531E22B142F3006E8DF2 /* SoxyTests */, 156 | B322009D1BBCAB23009829BD /* Products */, 157 | 20B9B6B60C5F3E789D88A06B /* Pods */, 158 | EF5795779882C007BE93527D /* Frameworks */, 159 | ); 160 | sourceTree = ""; 161 | }; 162 | B322009D1BBCAB23009829BD /* Products */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | AC2152C122B13736006E8DF2 /* SoxyExampleMacOs.app */, 166 | AC21531022B142F3006E8DF2 /* Soxy.framework */, 167 | AC21531822B142F3006E8DF2 /* SoxyTests.xctest */, 168 | ); 169 | name = Products; 170 | sourceTree = ""; 171 | }; 172 | B322009E1BBCAB23009829BD /* Soxy */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | B33C53C91BBFBE1300231FCE /* Soxy.swift */, 176 | B33C53C61BBFBC3600231FCE /* Server.swift */, 177 | B32200B21BBCAFA1009829BD /* Connection.swift */, 178 | B32B81E11D63D72A00076C52 /* GCDAsyncSocketExtensions.swift */, 179 | AC21531322B142F3006E8DF2 /* Info.plist */, 180 | ); 181 | path = Soxy; 182 | sourceTree = ""; 183 | }; 184 | EF5795779882C007BE93527D /* Frameworks */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 24292743C19C7BD004EC6D0B /* Pods_Soxy.framework */, 188 | 1B2D73D4B648DFCEE801A057 /* Pods_SoxyExampleMacOs.framework */, 189 | ); 190 | name = Frameworks; 191 | sourceTree = ""; 192 | }; 193 | /* End PBXGroup section */ 194 | 195 | /* Begin PBXHeadersBuildPhase section */ 196 | AC21530B22B142F3006E8DF2 /* Headers */ = { 197 | isa = PBXHeadersBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXHeadersBuildPhase section */ 204 | 205 | /* Begin PBXNativeTarget section */ 206 | AC2152C022B13736006E8DF2 /* SoxyExampleMacOs */ = { 207 | isa = PBXNativeTarget; 208 | buildConfigurationList = AC2152E422B1373B006E8DF2 /* Build configuration list for PBXNativeTarget "SoxyExampleMacOs" */; 209 | buildPhases = ( 210 | 4E89DFF1304838E3811A374B /* [CP] Check Pods Manifest.lock */, 211 | AC2152BD22B13736006E8DF2 /* Sources */, 212 | AC2152BE22B13736006E8DF2 /* Frameworks */, 213 | AC2152BF22B13736006E8DF2 /* Resources */, 214 | AC21532A22B142F3006E8DF2 /* Embed Frameworks */, 215 | ); 216 | buildRules = ( 217 | ); 218 | dependencies = ( 219 | AC21532422B142F3006E8DF2 /* PBXTargetDependency */, 220 | ); 221 | name = SoxyExampleMacOs; 222 | productName = example; 223 | productReference = AC2152C122B13736006E8DF2 /* SoxyExampleMacOs.app */; 224 | productType = "com.apple.product-type.application"; 225 | }; 226 | AC21530F22B142F3006E8DF2 /* Soxy */ = { 227 | isa = PBXNativeTarget; 228 | buildConfigurationList = AC21532722B142F3006E8DF2 /* Build configuration list for PBXNativeTarget "Soxy" */; 229 | buildPhases = ( 230 | 2C774A198EF72F3BAF335D20 /* [CP] Check Pods Manifest.lock */, 231 | AC21530B22B142F3006E8DF2 /* Headers */, 232 | AC21530C22B142F3006E8DF2 /* Sources */, 233 | AC21530D22B142F3006E8DF2 /* Frameworks */, 234 | AC21530E22B142F3006E8DF2 /* Resources */, 235 | ); 236 | buildRules = ( 237 | ); 238 | dependencies = ( 239 | ); 240 | name = Soxy; 241 | productName = Soxy1; 242 | productReference = AC21531022B142F3006E8DF2 /* Soxy.framework */; 243 | productType = "com.apple.product-type.framework"; 244 | }; 245 | AC21531722B142F3006E8DF2 /* SoxyTests */ = { 246 | isa = PBXNativeTarget; 247 | buildConfigurationList = AC21532B22B142F3006E8DF2 /* Build configuration list for PBXNativeTarget "SoxyTests" */; 248 | buildPhases = ( 249 | AC21531422B142F3006E8DF2 /* Sources */, 250 | AC21531522B142F3006E8DF2 /* Frameworks */, 251 | AC21531622B142F3006E8DF2 /* Resources */, 252 | ); 253 | buildRules = ( 254 | ); 255 | dependencies = ( 256 | AC21531B22B142F3006E8DF2 /* PBXTargetDependency */, 257 | AC21531D22B142F3006E8DF2 /* PBXTargetDependency */, 258 | ); 259 | name = SoxyTests; 260 | productName = Soxy1Tests; 261 | productReference = AC21531822B142F3006E8DF2 /* SoxyTests.xctest */; 262 | productType = "com.apple.product-type.bundle.unit-test"; 263 | }; 264 | /* End PBXNativeTarget section */ 265 | 266 | /* Begin PBXProject section */ 267 | B32200941BBCAB23009829BD /* Project object */ = { 268 | isa = PBXProject; 269 | attributes = { 270 | LastSwiftUpdateCheck = 1020; 271 | LastUpgradeCheck = 1020; 272 | ORGANIZATIONNAME = "Pop Tap"; 273 | TargetAttributes = { 274 | AC2152C022B13736006E8DF2 = { 275 | CreatedOnToolsVersion = 10.2.1; 276 | ProvisioningStyle = Automatic; 277 | }; 278 | AC21530F22B142F3006E8DF2 = { 279 | CreatedOnToolsVersion = 10.2.1; 280 | ProvisioningStyle = Automatic; 281 | }; 282 | AC21531722B142F3006E8DF2 = { 283 | CreatedOnToolsVersion = 10.2.1; 284 | ProvisioningStyle = Automatic; 285 | TestTargetID = AC2152C022B13736006E8DF2; 286 | }; 287 | }; 288 | }; 289 | buildConfigurationList = B32200971BBCAB23009829BD /* Build configuration list for PBXProject "Soxy" */; 290 | compatibilityVersion = "Xcode 3.2"; 291 | developmentRegion = English; 292 | hasScannedForEncodings = 0; 293 | knownRegions = ( 294 | English, 295 | en, 296 | Base, 297 | ); 298 | mainGroup = B32200931BBCAB23009829BD; 299 | productRefGroup = B322009D1BBCAB23009829BD /* Products */; 300 | projectDirPath = ""; 301 | projectRoot = ""; 302 | targets = ( 303 | AC2152C022B13736006E8DF2 /* SoxyExampleMacOs */, 304 | AC21530F22B142F3006E8DF2 /* Soxy */, 305 | AC21531722B142F3006E8DF2 /* SoxyTests */, 306 | ); 307 | }; 308 | /* End PBXProject section */ 309 | 310 | /* Begin PBXResourcesBuildPhase section */ 311 | AC2152BF22B13736006E8DF2 /* Resources */ = { 312 | isa = PBXResourcesBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | AC2152EE22B13742006E8DF2 /* Assets.xcassets in Resources */, 316 | AC2152CB22B1373A006E8DF2 /* Main.storyboard in Resources */, 317 | ); 318 | runOnlyForDeploymentPostprocessing = 0; 319 | }; 320 | AC21530E22B142F3006E8DF2 /* Resources */ = { 321 | isa = PBXResourcesBuildPhase; 322 | buildActionMask = 2147483647; 323 | files = ( 324 | ); 325 | runOnlyForDeploymentPostprocessing = 0; 326 | }; 327 | AC21531622B142F3006E8DF2 /* Resources */ = { 328 | isa = PBXResourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | ); 332 | runOnlyForDeploymentPostprocessing = 0; 333 | }; 334 | /* End PBXResourcesBuildPhase section */ 335 | 336 | /* Begin PBXShellScriptBuildPhase section */ 337 | 2C774A198EF72F3BAF335D20 /* [CP] Check Pods Manifest.lock */ = { 338 | isa = PBXShellScriptBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | ); 342 | inputFileListPaths = ( 343 | ); 344 | inputPaths = ( 345 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 346 | "${PODS_ROOT}/Manifest.lock", 347 | ); 348 | name = "[CP] Check Pods Manifest.lock"; 349 | outputFileListPaths = ( 350 | ); 351 | outputPaths = ( 352 | "$(DERIVED_FILE_DIR)/Pods-Soxy-checkManifestLockResult.txt", 353 | ); 354 | runOnlyForDeploymentPostprocessing = 0; 355 | shellPath = /bin/sh; 356 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 357 | showEnvVarsInLog = 0; 358 | }; 359 | 4E89DFF1304838E3811A374B /* [CP] Check Pods Manifest.lock */ = { 360 | isa = PBXShellScriptBuildPhase; 361 | buildActionMask = 2147483647; 362 | files = ( 363 | ); 364 | inputFileListPaths = ( 365 | ); 366 | inputPaths = ( 367 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 368 | "${PODS_ROOT}/Manifest.lock", 369 | ); 370 | name = "[CP] Check Pods Manifest.lock"; 371 | outputFileListPaths = ( 372 | ); 373 | outputPaths = ( 374 | "$(DERIVED_FILE_DIR)/Pods-SoxyExampleMacOs-checkManifestLockResult.txt", 375 | ); 376 | runOnlyForDeploymentPostprocessing = 0; 377 | shellPath = /bin/sh; 378 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 379 | showEnvVarsInLog = 0; 380 | }; 381 | /* End PBXShellScriptBuildPhase section */ 382 | 383 | /* Begin PBXSourcesBuildPhase section */ 384 | AC2152BD22B13736006E8DF2 /* Sources */ = { 385 | isa = PBXSourcesBuildPhase; 386 | buildActionMask = 2147483647; 387 | files = ( 388 | AC2152ED22B1373F006E8DF2 /* AppDelegate.swift in Sources */, 389 | ); 390 | runOnlyForDeploymentPostprocessing = 0; 391 | }; 392 | AC21530C22B142F3006E8DF2 /* Sources */ = { 393 | isa = PBXSourcesBuildPhase; 394 | buildActionMask = 2147483647; 395 | files = ( 396 | AC21532F22B1430A006E8DF2 /* Server.swift in Sources */, 397 | AC21533022B1430D006E8DF2 /* Connection.swift in Sources */, 398 | AC21533122B1430F006E8DF2 /* GCDAsyncSocketExtensions.swift in Sources */, 399 | AC21532E22B14306006E8DF2 /* Soxy.swift in Sources */, 400 | ); 401 | runOnlyForDeploymentPostprocessing = 0; 402 | }; 403 | AC21531422B142F3006E8DF2 /* Sources */ = { 404 | isa = PBXSourcesBuildPhase; 405 | buildActionMask = 2147483647; 406 | files = ( 407 | AC21532022B142F3006E8DF2 /* Soxy1Tests.swift in Sources */, 408 | ); 409 | runOnlyForDeploymentPostprocessing = 0; 410 | }; 411 | /* End PBXSourcesBuildPhase section */ 412 | 413 | /* Begin PBXTargetDependency section */ 414 | AC21531B22B142F3006E8DF2 /* PBXTargetDependency */ = { 415 | isa = PBXTargetDependency; 416 | target = AC21530F22B142F3006E8DF2 /* Soxy */; 417 | targetProxy = AC21531A22B142F3006E8DF2 /* PBXContainerItemProxy */; 418 | }; 419 | AC21531D22B142F3006E8DF2 /* PBXTargetDependency */ = { 420 | isa = PBXTargetDependency; 421 | target = AC2152C022B13736006E8DF2 /* SoxyExampleMacOs */; 422 | targetProxy = AC21531C22B142F3006E8DF2 /* PBXContainerItemProxy */; 423 | }; 424 | AC21532422B142F3006E8DF2 /* PBXTargetDependency */ = { 425 | isa = PBXTargetDependency; 426 | target = AC21530F22B142F3006E8DF2 /* Soxy */; 427 | targetProxy = AC21532322B142F3006E8DF2 /* PBXContainerItemProxy */; 428 | }; 429 | /* End PBXTargetDependency section */ 430 | 431 | /* Begin PBXVariantGroup section */ 432 | AC2152C922B1373A006E8DF2 /* Main.storyboard */ = { 433 | isa = PBXVariantGroup; 434 | children = ( 435 | AC2152CA22B1373A006E8DF2 /* Base */, 436 | ); 437 | name = Main.storyboard; 438 | sourceTree = ""; 439 | }; 440 | /* End PBXVariantGroup section */ 441 | 442 | /* Begin XCBuildConfiguration section */ 443 | AC2152E522B1373B006E8DF2 /* Debug */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = D40822025CADBF53E9F43791 /* Pods-SoxyExampleMacOs.debug.xcconfig */; 446 | buildSettings = { 447 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 448 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 449 | CLANG_ANALYZER_NONNULL = YES; 450 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 451 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 452 | CLANG_ENABLE_OBJC_WEAK = YES; 453 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 454 | CLANG_WARN_COMMA = YES; 455 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 456 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 457 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 458 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 459 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 460 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 461 | CLANG_WARN_STRICT_PROTOTYPES = YES; 462 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 463 | CODE_SIGN_ENTITLEMENTS = SoxyExampleMacOs/example.entitlements; 464 | CODE_SIGN_STYLE = Automatic; 465 | COMBINE_HIDPI_IMAGES = YES; 466 | GCC_C_LANGUAGE_STANDARD = gnu11; 467 | INFOPLIST_FILE = SoxyExampleMacOs/Info.plist; 468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 469 | MACOSX_DEPLOYMENT_TARGET = 10.14; 470 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 471 | MTL_FAST_MATH = YES; 472 | PRODUCT_BUNDLE_IDENTIFIER = "com.pop-tap.Soxy.example"; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 475 | SWIFT_VERSION = 5.0; 476 | }; 477 | name = Debug; 478 | }; 479 | AC2152E622B1373B006E8DF2 /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | baseConfigurationReference = 53F7C18F086E45EAB8D5161B /* Pods-SoxyExampleMacOs.release.xcconfig */; 482 | buildSettings = { 483 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 485 | CLANG_ANALYZER_NONNULL = YES; 486 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 487 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 488 | CLANG_ENABLE_OBJC_WEAK = YES; 489 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 490 | CLANG_WARN_COMMA = YES; 491 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 492 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 493 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 494 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 495 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 496 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 497 | CLANG_WARN_STRICT_PROTOTYPES = YES; 498 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 499 | CODE_SIGN_ENTITLEMENTS = SoxyExampleMacOs/example.entitlements; 500 | CODE_SIGN_STYLE = Automatic; 501 | COMBINE_HIDPI_IMAGES = YES; 502 | GCC_C_LANGUAGE_STANDARD = gnu11; 503 | INFOPLIST_FILE = SoxyExampleMacOs/Info.plist; 504 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 505 | MACOSX_DEPLOYMENT_TARGET = 10.14; 506 | MTL_FAST_MATH = YES; 507 | PRODUCT_BUNDLE_IDENTIFIER = "com.pop-tap.Soxy.example"; 508 | PRODUCT_NAME = "$(TARGET_NAME)"; 509 | SWIFT_VERSION = 5.0; 510 | }; 511 | name = Release; 512 | }; 513 | AC21532822B142F3006E8DF2 /* Debug */ = { 514 | isa = XCBuildConfiguration; 515 | baseConfigurationReference = 93C6557D799AA793C92D4F5A /* Pods-Soxy.debug.xcconfig */; 516 | buildSettings = { 517 | CLANG_ANALYZER_NONNULL = YES; 518 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 519 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 520 | CLANG_ENABLE_OBJC_WEAK = YES; 521 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 522 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 523 | CODE_SIGN_IDENTITY = ""; 524 | CODE_SIGN_STYLE = Automatic; 525 | COMBINE_HIDPI_IMAGES = YES; 526 | CURRENT_PROJECT_VERSION = 1; 527 | DEFINES_MODULE = YES; 528 | DYLIB_COMPATIBILITY_VERSION = 1; 529 | DYLIB_CURRENT_VERSION = 1; 530 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 531 | FRAMEWORK_VERSION = A; 532 | GCC_C_LANGUAGE_STANDARD = gnu11; 533 | INFOPLIST_FILE = "$(SRCROOT)/Soxy1/Info.plist"; 534 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 535 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 536 | MACOSX_DEPLOYMENT_TARGET = 10.14; 537 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 538 | MTL_FAST_MATH = YES; 539 | PRODUCT_BUNDLE_IDENTIFIER = "com.pop-tap.Soxy"; 540 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 541 | SKIP_INSTALL = YES; 542 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 543 | SWIFT_VERSION = 5.0; 544 | VERSIONING_SYSTEM = "apple-generic"; 545 | VERSION_INFO_PREFIX = ""; 546 | }; 547 | name = Debug; 548 | }; 549 | AC21532922B142F3006E8DF2 /* Release */ = { 550 | isa = XCBuildConfiguration; 551 | baseConfigurationReference = 8FB09830B9DCDE8DB9E4CA00 /* Pods-Soxy.release.xcconfig */; 552 | buildSettings = { 553 | CLANG_ANALYZER_NONNULL = YES; 554 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 555 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 556 | CLANG_ENABLE_OBJC_WEAK = YES; 557 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 558 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 559 | CODE_SIGN_IDENTITY = ""; 560 | CODE_SIGN_STYLE = Automatic; 561 | COMBINE_HIDPI_IMAGES = YES; 562 | CURRENT_PROJECT_VERSION = 1; 563 | DEFINES_MODULE = YES; 564 | DYLIB_COMPATIBILITY_VERSION = 1; 565 | DYLIB_CURRENT_VERSION = 1; 566 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 567 | FRAMEWORK_VERSION = A; 568 | GCC_C_LANGUAGE_STANDARD = gnu11; 569 | INFOPLIST_FILE = "$(SRCROOT)/Soxy1/Info.plist"; 570 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 571 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 572 | MACOSX_DEPLOYMENT_TARGET = 10.14; 573 | MTL_FAST_MATH = YES; 574 | PRODUCT_BUNDLE_IDENTIFIER = "com.pop-tap.Soxy"; 575 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 576 | SKIP_INSTALL = YES; 577 | SWIFT_VERSION = 5.0; 578 | VERSIONING_SYSTEM = "apple-generic"; 579 | VERSION_INFO_PREFIX = ""; 580 | }; 581 | name = Release; 582 | }; 583 | AC21532C22B142F3006E8DF2 /* Debug */ = { 584 | isa = XCBuildConfiguration; 585 | buildSettings = { 586 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 587 | CLANG_ANALYZER_NONNULL = YES; 588 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 589 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 590 | CLANG_ENABLE_OBJC_WEAK = YES; 591 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 592 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 593 | CODE_SIGN_STYLE = Automatic; 594 | COMBINE_HIDPI_IMAGES = YES; 595 | GCC_C_LANGUAGE_STANDARD = gnu11; 596 | INFOPLIST_FILE = SoxyTests/Info.plist; 597 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 598 | MACOSX_DEPLOYMENT_TARGET = 10.14; 599 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 600 | MTL_FAST_MATH = YES; 601 | PRODUCT_BUNDLE_IDENTIFIER = "com.pop-tap.Soxy1Tests"; 602 | PRODUCT_NAME = "$(TARGET_NAME)"; 603 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 604 | SWIFT_VERSION = 5.0; 605 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SoxyExampleMacOs.app/Contents/MacOS/SoxyExampleMacOs"; 606 | }; 607 | name = Debug; 608 | }; 609 | AC21532D22B142F3006E8DF2 /* Release */ = { 610 | isa = XCBuildConfiguration; 611 | buildSettings = { 612 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 613 | CLANG_ANALYZER_NONNULL = YES; 614 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 615 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 616 | CLANG_ENABLE_OBJC_WEAK = YES; 617 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 618 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 619 | CODE_SIGN_STYLE = Automatic; 620 | COMBINE_HIDPI_IMAGES = YES; 621 | GCC_C_LANGUAGE_STANDARD = gnu11; 622 | INFOPLIST_FILE = SoxyTests/Info.plist; 623 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 624 | MACOSX_DEPLOYMENT_TARGET = 10.14; 625 | MTL_FAST_MATH = YES; 626 | PRODUCT_BUNDLE_IDENTIFIER = "com.pop-tap.Soxy1Tests"; 627 | PRODUCT_NAME = "$(TARGET_NAME)"; 628 | SWIFT_VERSION = 5.0; 629 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SoxyExampleMacOs.app/Contents/MacOS/SoxyExampleMacOs"; 630 | }; 631 | name = Release; 632 | }; 633 | B32200A71BBCAB23009829BD /* Debug */ = { 634 | isa = XCBuildConfiguration; 635 | buildSettings = { 636 | ALWAYS_SEARCH_USER_PATHS = NO; 637 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 638 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 639 | CLANG_CXX_LIBRARY = "libc++"; 640 | CLANG_ENABLE_MODULES = YES; 641 | CLANG_ENABLE_OBJC_ARC = YES; 642 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 643 | CLANG_WARN_BOOL_CONVERSION = YES; 644 | CLANG_WARN_COMMA = YES; 645 | CLANG_WARN_CONSTANT_CONVERSION = YES; 646 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 647 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 648 | CLANG_WARN_EMPTY_BODY = YES; 649 | CLANG_WARN_ENUM_CONVERSION = YES; 650 | CLANG_WARN_INFINITE_RECURSION = YES; 651 | CLANG_WARN_INT_CONVERSION = YES; 652 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 653 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 654 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 655 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 656 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 657 | CLANG_WARN_STRICT_PROTOTYPES = YES; 658 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 659 | CLANG_WARN_UNREACHABLE_CODE = YES; 660 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 661 | CODE_SIGN_IDENTITY = "-"; 662 | COPY_PHASE_STRIP = NO; 663 | DEBUG_INFORMATION_FORMAT = dwarf; 664 | ENABLE_STRICT_OBJC_MSGSEND = YES; 665 | ENABLE_TESTABILITY = YES; 666 | GCC_C_LANGUAGE_STANDARD = gnu99; 667 | GCC_DYNAMIC_NO_PIC = NO; 668 | GCC_NO_COMMON_BLOCKS = YES; 669 | GCC_OPTIMIZATION_LEVEL = 0; 670 | GCC_PREPROCESSOR_DEFINITIONS = ( 671 | "DEBUG=1", 672 | "$(inherited)", 673 | ); 674 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 675 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 676 | GCC_WARN_UNDECLARED_SELECTOR = YES; 677 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 678 | GCC_WARN_UNUSED_FUNCTION = YES; 679 | GCC_WARN_UNUSED_VARIABLE = YES; 680 | MACOSX_DEPLOYMENT_TARGET = 10.11; 681 | MTL_ENABLE_DEBUG_INFO = YES; 682 | ONLY_ACTIVE_ARCH = YES; 683 | SDKROOT = macosx; 684 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 685 | SWIFT_VERSION = 5.0; 686 | }; 687 | name = Debug; 688 | }; 689 | B32200A81BBCAB23009829BD /* Release */ = { 690 | isa = XCBuildConfiguration; 691 | buildSettings = { 692 | ALWAYS_SEARCH_USER_PATHS = NO; 693 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 694 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 695 | CLANG_CXX_LIBRARY = "libc++"; 696 | CLANG_ENABLE_MODULES = YES; 697 | CLANG_ENABLE_OBJC_ARC = YES; 698 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 699 | CLANG_WARN_BOOL_CONVERSION = YES; 700 | CLANG_WARN_COMMA = YES; 701 | CLANG_WARN_CONSTANT_CONVERSION = YES; 702 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 703 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 704 | CLANG_WARN_EMPTY_BODY = YES; 705 | CLANG_WARN_ENUM_CONVERSION = YES; 706 | CLANG_WARN_INFINITE_RECURSION = YES; 707 | CLANG_WARN_INT_CONVERSION = YES; 708 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 709 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 710 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 711 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 712 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 713 | CLANG_WARN_STRICT_PROTOTYPES = YES; 714 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 715 | CLANG_WARN_UNREACHABLE_CODE = YES; 716 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 717 | CODE_SIGN_IDENTITY = "-"; 718 | COPY_PHASE_STRIP = NO; 719 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 720 | ENABLE_NS_ASSERTIONS = NO; 721 | ENABLE_STRICT_OBJC_MSGSEND = YES; 722 | GCC_C_LANGUAGE_STANDARD = gnu99; 723 | GCC_NO_COMMON_BLOCKS = YES; 724 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 725 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 726 | GCC_WARN_UNDECLARED_SELECTOR = YES; 727 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 728 | GCC_WARN_UNUSED_FUNCTION = YES; 729 | GCC_WARN_UNUSED_VARIABLE = YES; 730 | MACOSX_DEPLOYMENT_TARGET = 10.11; 731 | MTL_ENABLE_DEBUG_INFO = NO; 732 | SDKROOT = macosx; 733 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 734 | SWIFT_VERSION = 5.0; 735 | }; 736 | name = Release; 737 | }; 738 | /* End XCBuildConfiguration section */ 739 | 740 | /* Begin XCConfigurationList section */ 741 | AC2152E422B1373B006E8DF2 /* Build configuration list for PBXNativeTarget "SoxyExampleMacOs" */ = { 742 | isa = XCConfigurationList; 743 | buildConfigurations = ( 744 | AC2152E522B1373B006E8DF2 /* Debug */, 745 | AC2152E622B1373B006E8DF2 /* Release */, 746 | ); 747 | defaultConfigurationIsVisible = 0; 748 | defaultConfigurationName = Release; 749 | }; 750 | AC21532722B142F3006E8DF2 /* Build configuration list for PBXNativeTarget "Soxy" */ = { 751 | isa = XCConfigurationList; 752 | buildConfigurations = ( 753 | AC21532822B142F3006E8DF2 /* Debug */, 754 | AC21532922B142F3006E8DF2 /* Release */, 755 | ); 756 | defaultConfigurationIsVisible = 0; 757 | defaultConfigurationName = Release; 758 | }; 759 | AC21532B22B142F3006E8DF2 /* Build configuration list for PBXNativeTarget "SoxyTests" */ = { 760 | isa = XCConfigurationList; 761 | buildConfigurations = ( 762 | AC21532C22B142F3006E8DF2 /* Debug */, 763 | AC21532D22B142F3006E8DF2 /* Release */, 764 | ); 765 | defaultConfigurationIsVisible = 0; 766 | defaultConfigurationName = Release; 767 | }; 768 | B32200971BBCAB23009829BD /* Build configuration list for PBXProject "Soxy" */ = { 769 | isa = XCConfigurationList; 770 | buildConfigurations = ( 771 | B32200A71BBCAB23009829BD /* Debug */, 772 | B32200A81BBCAB23009829BD /* Release */, 773 | ); 774 | defaultConfigurationIsVisible = 0; 775 | defaultConfigurationName = Release; 776 | }; 777 | /* End XCConfigurationList section */ 778 | }; 779 | rootObject = B32200941BBCAB23009829BD /* Project object */; 780 | } 781 | -------------------------------------------------------------------------------- /SoxyExampleMacOs/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | Default 530 | 531 | 532 | 533 | 534 | 535 | 536 | Left to Right 537 | 538 | 539 | 540 | 541 | 542 | 543 | Right to Left 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | Default 555 | 556 | 557 | 558 | 559 | 560 | 561 | Left to Right 562 | 563 | 564 | 565 | 566 | 567 | 568 | Right to Left 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | --------------------------------------------------------------------------------