diff --git a/.gitmodules b/.gitmodules index 63f6f1b..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "Source/Starscream"] - path = Source/Starscream - url = https://github.com/nuclearace/Starscream - branch = socket.io-dev diff --git a/.travis.yml b/.travis.yml index 46c3a79..fe1c178 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,17 @@ language: objective-c xcode_project: Socket.IO-Client-Swift.xcodeproj # path to your xcodeproj folder -xcode_scheme: SocketIO-iOS +xcode_scheme: SocketIO-Mac osx_image: xcode9 branches: only: - master - development - - swift4.0 before_install: - brew update - brew outdated xctool || brew upgrade xctool + - brew outdated carthage || brew upgrade carthage script: + - carthage update - xcodebuild -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac build test -quiet # - xcodebuild -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac build-for-testing -quiet # - xctool -project Socket.IO-Client-Swift.xcodeproj -scheme SocketIO-Mac run-tests --parallelize diff --git a/Cartfile b/Cartfile new file mode 100644 index 0000000..2ef3a0d --- /dev/null +++ b/Cartfile @@ -0,0 +1 @@ +github "daltoniam/Starscream" ~> 2.0 \ No newline at end of file diff --git a/Cartfile.resolved b/Cartfile.resolved new file mode 100644 index 0000000..be023fb --- /dev/null +++ b/Cartfile.resolved @@ -0,0 +1 @@ +github "daltoniam/Starscream" "2.1.1" diff --git a/Package.swift b/Package.swift index 34c1298..61ff8a5 100644 --- a/Package.swift +++ b/Package.swift @@ -8,9 +8,9 @@ let package = Package( .library(name: "SocketIO", targets: ["SocketIO"]) ], dependencies: [ - .package(url: "https://github.com/nuclearace/Starscream", .upToNextMajor(from: "9.0.0")), + .package(url: "https://github.com/daltoniam/Starscream", .upToNextMajor(from: "2.1.1")), ], targets: [ - .target(name: "SocketIO", dependencies: ["StarscreamSocketIO"], exclude: ["Sources/Starscream"]) + .target(name: "SocketIO", dependencies: ["Starscream"]) ] ) diff --git a/Socket.IO-Client-Swift.xcodeproj/project.pbxproj b/Socket.IO-Client-Swift.xcodeproj/project.pbxproj index 3b09edc..c870e3f 100644 --- a/Socket.IO-Client-Swift.xcodeproj/project.pbxproj +++ b/Socket.IO-Client-Swift.xcodeproj/project.pbxproj @@ -30,12 +30,22 @@ 7472C65F1BCAC46E003CA70D /* SocketSideEffectTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7472C65E1BCAC46E003CA70D /* SocketSideEffectTest.swift */; }; 7472C6601BCAC46E003CA70D /* SocketSideEffectTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7472C65E1BCAC46E003CA70D /* SocketSideEffectTest.swift */; }; 747BC59F1D5F9BA200CA5FA4 /* SocketIOClientConfigurationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 747BC59E1D5F9BA200CA5FA4 /* SocketIOClientConfigurationTest.swift */; }; - 74DA21721F094408009C19EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 74DA21711F094408009C19EE /* libz.tbd */; }; + 749FA1961F811190002FBB30 /* SocketAckManagerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74321DC91C2D939A00CF6F43 /* SocketAckManagerTest.swift */; }; + 749FA1971F811190002FBB30 /* SocketIOClientConfigurationTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 747BC59E1D5F9BA200CA5FA4 /* SocketIOClientConfigurationTest.swift */; }; + 749FA1981F811190002FBB30 /* SocketObjectiveCTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 742D150B1CA5794B00BD987D /* SocketObjectiveCTest.m */; }; + 749FA1991F811190002FBB30 /* SocketParserTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74321DCA1C2D939A00CF6F43 /* SocketParserTest.swift */; }; + 749FA1A61F81152B002FBB30 /* Starscream.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9432E00B1F77F883006AF628 /* Starscream.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 74D0F58E1F804FED0037C4DC /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 74D0F58D1F804FED0037C4DC /* libz.tbd */; }; + 74D0F5961F8053950037C4DC /* Starscream.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9432E00B1F77F883006AF628 /* Starscream.framework */; }; 74DA21741F09440F009C19EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 74DA21731F09440F009C19EE /* libz.tbd */; }; - 74DA21761F094417009C19EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 74DA21751F094417009C19EE /* libz.tbd */; }; 74DA217C1F09457B009C19EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 74DA21731F09440F009C19EE /* libz.tbd */; }; 74F124F01BC574CF002966F4 /* SocketBasicPacketTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74F124EF1BC574CF002966F4 /* SocketBasicPacketTest.swift */; }; 74F124F11BC574CF002966F4 /* SocketBasicPacketTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74F124EF1BC574CF002966F4 /* SocketBasicPacketTest.swift */; }; + 9432E0071F77F7CA006AF628 /* SSLSecurity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9432E0061F77F7CA006AF628 /* SSLSecurity.swift */; }; + 9432E00A1F77F87D006AF628 /* Starscream.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9432E0091F77F87D006AF628 /* Starscream.framework */; }; + 9432E00E1F77F889006AF628 /* Starscream.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9432E00D1F77F889006AF628 /* Starscream.framework */; }; + 9432E00F1F77F8C4006AF628 /* SSLSecurity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9432E0061F77F7CA006AF628 /* SSLSecurity.swift */; }; + 9432E0101F77F8C4006AF628 /* SSLSecurity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9432E0061F77F7CA006AF628 /* SSLSecurity.swift */; }; DD52B048C71D724ABBD18C71 /* SocketTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52BDC9E66AADA2CC5E8246 /* SocketTypes.swift */; }; DD52B06F898CD9164AC8F80E /* SocketAnyEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52B5A9DE10C7A8AD35617F /* SocketAnyEvent.swift */; }; DD52B099A5166C5FF975FAB5 /* SocketClientManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD52B282975446C9A9C56D7B /* SocketClientManager.swift */; }; @@ -126,43 +136,21 @@ remoteGlobalIDString = 576349FA1BD9B46A00E19CD7; remoteInfo = "SocketIO-tvOS"; }; - 74B3C8391F7F3ECE007D96C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 74638B5A1F111CD000F5E1FF /* Starscream.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 33CCF0921F5DDC030099B092; - remoteInfo = StarscreamSocketIO; - }; - 74B3C83B1F7F3ECE007D96C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 74638B5A1F111CD000F5E1FF /* Starscream.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 335FA2021F5DF71D00F6D2EC; - remoteInfo = "Starscream Tests"; - }; - 74B3C8411F7F3F93007D96C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 74638B5A1F111CD000F5E1FF /* Starscream.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 33CCF0841F5DDC030099B092; - remoteInfo = StarscreamSocketIO; - }; - 74B3C8431F7F3F98007D96C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 74638B5A1F111CD000F5E1FF /* Starscream.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 33CCF0841F5DDC030099B092; - remoteInfo = StarscreamSocketIO; - }; - 74B3C8451F7F3F9C007D96C8 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 74638B5A1F111CD000F5E1FF /* Starscream.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 33CCF0841F5DDC030099B092; - remoteInfo = StarscreamSocketIO; - }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 749FA1A51F811521002FBB30 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 749FA1A61F81152B002FBB30 /* Starscream.framework in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 572EF2191B51F16C00EEBB58 /* SocketIO.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SocketIO.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 572EF21D1B51F16C00EEBB58 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -182,15 +170,19 @@ 742D150B1CA5794B00BD987D /* SocketObjectiveCTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SocketObjectiveCTest.m; sourceTree = ""; }; 74321DC91C2D939A00CF6F43 /* SocketAckManagerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketAckManagerTest.swift; sourceTree = ""; }; 74321DCA1C2D939A00CF6F43 /* SocketParserTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketParserTest.swift; sourceTree = ""; }; - 74638B5A1F111CD000F5E1FF /* Starscream.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Starscream.xcodeproj; path = Source/Starscream/Starscream.xcodeproj; sourceTree = ""; }; 7472C65B1BCAB53E003CA70D /* SocketNamespacePacketTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketNamespacePacketTest.swift; sourceTree = ""; }; 7472C65E1BCAC46E003CA70D /* SocketSideEffectTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketSideEffectTest.swift; sourceTree = ""; }; 747BC59E1D5F9BA200CA5FA4 /* SocketIOClientConfigurationTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketIOClientConfigurationTest.swift; sourceTree = ""; }; - 74DA21711F094408009C19EE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; + 749FA19F1F8112E7002FBB30 /* Starscream.framework.dSYM */ = {isa = PBXFileReference; lastKnownFileType = wrapper.dsym; name = Starscream.framework.dSYM; path = Carthage/Build/Mac/Starscream.framework.dSYM; sourceTree = ""; }; + 749FA1A11F811408002FBB30 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 74D0F58D1F804FED0037C4DC /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; 74DA21731F09440F009C19EE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - 74DA21751F094417009C19EE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS10.2.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; 74DA217D1F0945E9009C19EE /* libcommonCrypto.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcommonCrypto.tbd; path = usr/lib/system/libcommonCrypto.tbd; sourceTree = SDKROOT; }; 74F124EF1BC574CF002966F4 /* SocketBasicPacketTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketBasicPacketTest.swift; sourceTree = ""; }; + 9432E0061F77F7CA006AF628 /* SSLSecurity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSLSecurity.swift; sourceTree = ""; }; + 9432E0091F77F87D006AF628 /* Starscream.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Starscream.framework; path = Carthage/Build/iOS/Starscream.framework; sourceTree = ""; }; + 9432E00B1F77F883006AF628 /* Starscream.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Starscream.framework; path = Carthage/Build/Mac/Starscream.framework; sourceTree = ""; }; + 9432E00D1F77F889006AF628 /* Starscream.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Starscream.framework; path = Carthage/Build/tvOS/Starscream.framework; sourceTree = ""; }; DD52B078DB0A3C3D1BB507CD /* SocketIOClientOption.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketIOClientOption.swift; sourceTree = ""; }; DD52B09F7984E730513AB7E5 /* SocketAckManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketAckManager.swift; sourceTree = ""; }; DD52B1D9BC4AE46D38D827DE /* SocketIOClientStatus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketIOClientStatus.swift; sourceTree = ""; }; @@ -220,8 +212,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 74DA21721F094408009C19EE /* libz.tbd in Frameworks */, + 74D0F58E1F804FED0037C4DC /* libz.tbd in Frameworks */, 6CA08A961D615C040061FD2A /* Security.framework in Frameworks */, + 9432E00A1F77F87D006AF628 /* Starscream.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -239,6 +232,7 @@ files = ( 74DA21741F09440F009C19EE /* libz.tbd in Frameworks */, 6CA08A981D615C0B0061FD2A /* Security.framework in Frameworks */, + 74D0F5961F8053950037C4DC /* Starscream.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -255,8 +249,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 74DA21761F094417009C19EE /* libz.tbd in Frameworks */, 6CA08A9A1D615C140061FD2A /* Security.framework in Frameworks */, + 9432E00E1F77F889006AF628 /* Starscream.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -274,7 +268,6 @@ 572EF20D1B51F12F00EEBB58 = { isa = PBXGroup; children = ( - 74638B5A1F111CD000F5E1FF /* Starscream.xcodeproj */, 6CA08A9B1D615C190061FD2A /* Frameworks */, 572EF21A1B51F16C00EEBB58 /* Products */, 572EF21B1B51F16C00EEBB58 /* SocketIO-iOS */, @@ -370,10 +363,14 @@ 6CA08A9B1D615C190061FD2A /* Frameworks */ = { isa = PBXGroup; children = ( + 749FA1A11F811408002FBB30 /* Foundation.framework */, + 749FA19F1F8112E7002FBB30 /* Starscream.framework.dSYM */, + 74D0F58D1F804FED0037C4DC /* libz.tbd */, + 9432E0091F77F87D006AF628 /* Starscream.framework */, + 9432E00B1F77F883006AF628 /* Starscream.framework */, + 9432E00D1F77F889006AF628 /* Starscream.framework */, 74DA217D1F0945E9009C19EE /* libcommonCrypto.tbd */, - 74DA21751F094417009C19EE /* libz.tbd */, 74DA21731F09440F009C19EE /* libz.tbd */, - 74DA21711F094408009C19EE /* libz.tbd */, 6CA08A9E1D615C340061FD2A /* tvOS */, 6CA08A9D1D615C2C0061FD2A /* Mac */, 6CA08A9C1D615C270061FD2A /* iOS */, @@ -405,15 +402,6 @@ name = tvOS; sourceTree = ""; }; - 74638B5B1F111CD000F5E1FF /* Products */ = { - isa = PBXGroup; - children = ( - 74B3C83A1F7F3ECE007D96C8 /* StarscreamSocketIO.framework */, - 74B3C83C1F7F3ECE007D96C8 /* Starscream Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; DD52B1D10D761CEF3944A6BC /* Util */ = { isa = PBXGroup; children = ( @@ -422,6 +410,7 @@ DD52B471D780013E18DF9335 /* SocketExtensions.swift */, DD52BA240D139F72633D4159 /* SocketStringReader.swift */, DD52B282975446C9A9C56D7B /* SocketClientManager.swift */, + 9432E0061F77F7CA006AF628 /* SSLSecurity.swift */, ); name = Util; path = Source/SocketIO/Util; @@ -518,7 +507,6 @@ buildRules = ( ); dependencies = ( - 74B3C8461F7F3F9C007D96C8 /* PBXTargetDependency */, ); name = "SocketIO-iOS"; productName = "SocketIO-iOS"; @@ -532,6 +520,7 @@ 572EF2201B51F16C00EEBB58 /* Sources */, 572EF2211B51F16C00EEBB58 /* Frameworks */, 572EF2221B51F16C00EEBB58 /* Resources */, + 749FA19A1F8111A6002FBB30 /* ShellScript */, ); buildRules = ( ); @@ -555,7 +544,6 @@ buildRules = ( ); dependencies = ( - 74B3C8441F7F3F98007D96C8 /* PBXTargetDependency */, ); name = "SocketIO-Mac"; productName = "SocketIO-Mac"; @@ -569,6 +557,7 @@ 572EF23E1B51F18A00EEBB58 /* Sources */, 572EF23F1B51F18A00EEBB58 /* Frameworks */, 572EF2401B51F18A00EEBB58 /* Resources */, + 749FA1A51F811521002FBB30 /* CopyFiles */, ); buildRules = ( ); @@ -592,7 +581,6 @@ buildRules = ( ); dependencies = ( - 74B3C8421F7F3F93007D96C8 /* PBXTargetDependency */, ); name = "SocketIO-tvOS"; productName = "SocketIO-iOS"; @@ -653,12 +641,6 @@ mainGroup = 572EF20D1B51F12F00EEBB58; productRefGroup = 572EF21A1B51F16C00EEBB58 /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 74638B5B1F111CD000F5E1FF /* Products */; - ProjectRef = 74638B5A1F111CD000F5E1FF /* Starscream.xcodeproj */; - }, - ); projectRoot = ""; targets = ( 572EF2181B51F16C00EEBB58 /* SocketIO-iOS */, @@ -671,23 +653,6 @@ }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 74B3C83A1F7F3ECE007D96C8 /* StarscreamSocketIO.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = StarscreamSocketIO.framework; - remoteRef = 74B3C8391F7F3ECE007D96C8 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 74B3C83C1F7F3ECE007D96C8 /* Starscream Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Starscream Tests.xctest"; - remoteRef = 74B3C83B1F7F3ECE007D96C8 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ 572EF2171B51F16C00EEBB58 /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -733,6 +698,24 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 749FA19A1F8111A6002FBB30 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/Carthage/Build/iOS/Starscream.framework", + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Starscream.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/usr/local/bin/carthage copy-frameworks"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 572EF2141B51F16C00EEBB58 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -749,6 +732,7 @@ DD52B06F898CD9164AC8F80E /* SocketAnyEvent.swift in Sources */, DD52B16128003D74FC23A01F /* SocketIOClient.swift in Sources */, DD52BDB51FE41BAB49073BEF /* SocketEventHandler.swift in Sources */, + 9432E0071F77F7CA006AF628 /* SSLSecurity.swift in Sources */, DD52BB88BD4C5641CFD2E8D4 /* SocketIOClientSpec.swift in Sources */, DD52B1FEE4C81226884B1E67 /* SocketIOClientOption.swift in Sources */, DD52B6E44917CA5DFC3CE6B5 /* SocketIOClientStatus.swift in Sources */, @@ -767,6 +751,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 749FA1961F811190002FBB30 /* SocketAckManagerTest.swift in Sources */, + 749FA1971F811190002FBB30 /* SocketIOClientConfigurationTest.swift in Sources */, + 749FA1981F811190002FBB30 /* SocketObjectiveCTest.m in Sources */, + 749FA1991F811190002FBB30 /* SocketParserTest.swift in Sources */, 7472C65F1BCAC46E003CA70D /* SocketSideEffectTest.swift in Sources */, 741F39EE1BD025D80026C9CC /* SocketEngineTest.swift in Sources */, 74F124F01BC574CF002966F4 /* SocketBasicPacketTest.swift in Sources */, @@ -789,6 +777,7 @@ DD52BB69B6D260035B652CA4 /* SocketAnyEvent.swift in Sources */, DD52BF924BEF05E1235CFD29 /* SocketIOClient.swift in Sources */, DD52BFEB4DBD3BF8D93DAEFF /* SocketEventHandler.swift in Sources */, + 9432E00F1F77F8C4006AF628 /* SSLSecurity.swift in Sources */, DD52BB9A3E42FF2DD6BE7C2F /* SocketIOClientSpec.swift in Sources */, DD52B2AFE7D46039C7AE4D19 /* SocketIOClientOption.swift in Sources */, DD52BE4D1E6BB752CD9614A6 /* SocketIOClientStatus.swift in Sources */, @@ -833,6 +822,7 @@ DD52B6BE1D398DBD144C4D14 /* SocketAnyEvent.swift in Sources */, DD52B26DA9E4D566276B7E49 /* SocketIOClient.swift in Sources */, DD52B27DABA4C475B850A326 /* SocketEventHandler.swift in Sources */, + 9432E0101F77F8C4006AF628 /* SSLSecurity.swift in Sources */, DD52B4223DCCB75630441370 /* SocketIOClientSpec.swift in Sources */, DD52B6FC2F0A6A3106FFCBE3 /* SocketIOClientOption.swift in Sources */, DD52B3D941DB2A0C678F8251 /* SocketIOClientStatus.swift in Sources */, @@ -876,21 +866,6 @@ target = 576349FA1BD9B46A00E19CD7 /* SocketIO-tvOS */; targetProxy = 57634A3D1BD9B4B800E19CD7 /* PBXContainerItemProxy */; }; - 74B3C8421F7F3F93007D96C8 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = StarscreamSocketIO; - targetProxy = 74B3C8411F7F3F93007D96C8 /* PBXContainerItemProxy */; - }; - 74B3C8441F7F3F98007D96C8 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = StarscreamSocketIO; - targetProxy = 74B3C8431F7F3F98007D96C8 /* PBXContainerItemProxy */; - }; - 74B3C8461F7F3F9C007D96C8 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = StarscreamSocketIO; - targetProxy = 74B3C8451F7F3F9C007D96C8 /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -930,7 +905,7 @@ ONLY_ACTIVE_ARCH = YES; PRODUCT_NAME = SocketIO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -969,7 +944,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.10; PRODUCT_NAME = SocketIO; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.0; WATCHOS_DEPLOYMENT_TARGET = 2.0; }; @@ -1003,6 +978,10 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1027,7 +1006,6 @@ SKIP_INSTALL = YES; SWIFT_INCLUDE_PATHS = $SRCROOT/zlib; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1064,6 +1042,10 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -1080,7 +1062,6 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_INCLUDE_PATHS = $SRCROOT/zlib; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -1216,6 +1197,10 @@ ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); FRAMEWORK_VERSION = A; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -1282,6 +1267,10 @@ ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", + ); FRAMEWORK_VERSION = A; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; @@ -1336,6 +1325,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -1397,6 +1387,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/Mac", ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; @@ -1450,6 +1441,10 @@ DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/tvOS", + ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -1512,6 +1507,10 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/tvOS", + ); GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/SocketIO-MacTests/SocketObjectiveCTest.m b/SocketIO-MacTests/SocketObjectiveCTest.m index 6474123..6246701 100644 --- a/SocketIO-MacTests/SocketObjectiveCTest.m +++ b/SocketIO-MacTests/SocketObjectiveCTest.m @@ -11,7 +11,6 @@ @import Foundation; @import XCTest; @import SocketIO; -@import StarscreamSocketIO; @interface SocketObjectiveCTest : XCTestCase diff --git a/SocketIO-MacTests/SocketSideEffectTest.swift b/SocketIO-MacTests/SocketSideEffectTest.swift index b92ce62..bf9a12e 100644 --- a/SocketIO-MacTests/SocketSideEffectTest.swift +++ b/SocketIO-MacTests/SocketSideEffectTest.swift @@ -8,7 +8,6 @@ import XCTest @testable import SocketIO -@testable import StarscreamSocketIO class SocketSideEffectTest: XCTestCase { func testInitialCurrentAck() { diff --git a/Source/SocketIO/Client/SocketIOClientOption.swift b/Source/SocketIO/Client/SocketIOClientOption.swift index e258bbd..10b521e 100644 --- a/Source/SocketIO/Client/SocketIOClientOption.swift +++ b/Source/SocketIO/Client/SocketIOClientOption.swift @@ -23,7 +23,7 @@ // THE SOFTWARE. import Foundation -import StarscreamSocketIO +import Starscream protocol ClientOption : CustomStringConvertible, Equatable { func getSocketIOOptionValue() -> Any diff --git a/Source/SocketIO/Engine/SocketEngine.swift b/Source/SocketIO/Engine/SocketEngine.swift index 9553757..64bf370 100644 --- a/Source/SocketIO/Engine/SocketEngine.swift +++ b/Source/SocketIO/Engine/SocketEngine.swift @@ -24,7 +24,7 @@ import Dispatch import Foundation -import StarscreamSocketIO +import Starscream /// The class that handles the engine.io protocol and transports. /// See `SocketEnginePollable` and `SocketEngineWebsocket` for transport specific methods. @@ -134,7 +134,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll private var pongsMissedMax = 0 private var probeWait = ProbeWaitQueue() private var secure = false - private var security: SSLSecurity? + private var security: SocketIO.SSLSecurity? private var selfSigned = false // MARK: Initializers @@ -310,27 +310,27 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll private func createWebSocketAndConnect() { ws?.delegate = nil // TODO this seems a bit defensive, is this really needed? - var request = URLRequest(url: urlWebSocketWithSid) + ws = WebSocket(url: urlWebSocketWithSid) if cookies != nil { let headers = HTTPCookie.requestHeaderFields(with: cookies!) for (key, value) in headers { - request.setValue(value, forHTTPHeaderField: key) + ws?.headers[key] = value } } if extraHeaders != nil { for (headerName, value) in extraHeaders! { - request.setValue(value, forHTTPHeaderField: headerName) + ws?.headers[headerName] = value } } - ws = WebSocket(request: request) + ws?.callbackQueue = engineQueue ws?.enableCompression = compress ws?.delegate = self ws?.disableSSLCertValidation = selfSigned - ws?.security = security + ws?.security = security?.security ws?.connect() } @@ -605,7 +605,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll // MARK: Starscream delegate conformance /// Delegate method for connection. - public func websocketDidConnect(socket: WebSocketClient) { + public func websocketDidConnect(socket: WebSocket) { if !forceWebsockets { probing = true probeWebSocket() @@ -617,7 +617,7 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll } /// Delegate method for disconnection. - public func websocketDidDisconnect(socket: WebSocketClient, error: Error?) { + public func websocketDidDisconnect(socket: WebSocket, error: NSError?) { probing = false if closed { diff --git a/Source/SocketIO/Engine/SocketEngineSpec.swift b/Source/SocketIO/Engine/SocketEngineSpec.swift index 0f549db..4dba805 100644 --- a/Source/SocketIO/Engine/SocketEngineSpec.swift +++ b/Source/SocketIO/Engine/SocketEngineSpec.swift @@ -24,7 +24,7 @@ // import Foundation -import StarscreamSocketIO +import Starscream /// Specifies a SocketEngine. @objc public protocol SocketEngineSpec { diff --git a/Source/SocketIO/Engine/SocketEngineWebsocket.swift b/Source/SocketIO/Engine/SocketEngineWebsocket.swift index 7e432aa..514ea3a 100644 --- a/Source/SocketIO/Engine/SocketEngineWebsocket.swift +++ b/Source/SocketIO/Engine/SocketEngineWebsocket.swift @@ -24,7 +24,7 @@ // import Foundation -import StarscreamSocketIO +import Starscream /// Protocol that is used to implement socket.io WebSocket support public protocol SocketEngineWebsocket : SocketEngineSpec, WebSocketDelegate { @@ -68,12 +68,12 @@ extension SocketEngineWebsocket { // MARK: Starscream delegate methods /// Delegate method for when a message is received. - public func websocketDidReceiveMessage(socket: WebSocketClient, text: String) { + public func websocketDidReceiveMessage(socket: WebSocket, text: String) { parseEngineMessage(text) } /// Delegate method for when binary is received. - public func websocketDidReceiveData(socket: WebSocketClient, data: Data) { + public func websocketDidReceiveData(socket: WebSocket, data: Data) { parseEngineData(data) } } diff --git a/Source/SocketIO/Util/SSLSecurity.swift b/Source/SocketIO/Util/SSLSecurity.swift new file mode 100644 index 0000000..e49581e --- /dev/null +++ b/Source/SocketIO/Util/SSLSecurity.swift @@ -0,0 +1,32 @@ +// +// SSLSecurity.swift +// SocketIO-iOS +// +// Created by Lukas Schmidt on 24.09.17. +// + +import Foundation +import Starscream + +public class SSLSecurity: NSObject { + public let security: Starscream.SSLSecurity + + init(security: Starscream.SSLSecurity) { + self.security = security + } + + @objc + public convenience init(usePublicKeys: Bool = true) { + let security = Starscream.SSLSecurity(usePublicKeys: usePublicKeys) + self.init(security: security) + } + + public convenience init(certs: [SSLCert], usePublicKeys: Bool) { + let security = Starscream.SSLSecurity(certs: certs, usePublicKeys: usePublicKeys) + self.init(security: security) + } + + public func isValid(_ trust: SecTrust, domain: String?) -> Bool { + return security.isValid(trust, domain: domain) + } +} diff --git a/Source/SocketIO/Util/SocketExtensions.swift b/Source/SocketIO/Util/SocketExtensions.swift index 3959f6d..e80cf6e 100644 --- a/Source/SocketIO/Util/SocketExtensions.swift +++ b/Source/SocketIO/Util/SocketExtensions.swift @@ -23,7 +23,7 @@ // THE SOFTWARE. import Foundation -import StarscreamSocketIO +import Starscream enum JSONError : Error { case notArray diff --git a/Source/Starscream b/Source/Starscream deleted file mode 160000 index 24e71ab..0000000 --- a/Source/Starscream +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24e71ab1c8855dbc16325d5cca6bceae918d5ea8