Compare commits

...

93 Commits

Author SHA1 Message Date
Kristaps Grinbergs ebdc260ea6 Merge pull request #572 from daltoniam/self_swift_4.2
Using s = self in Swift 4.2 way
2018-10-09 11:42:07 +03:00
Kristaps Grinbergs 361a905d30 Using s = self in Swift 4.2 way 2018-10-08 20:19:36 +03:00
Kristaps Grinbergs 0f18ae5959 Merge pull request #570 from vonox7/patch-1
Add onHttpResponseHeaders callback. Fixes #567
2018-10-08 19:42:58 +03:00
Kristaps Grinbergs 82a01218cc Merge pull request #569 from daltoniam/release_action
Release action with fastlane
2018-10-08 19:36:51 +03:00
Valentin Slawicek 46d8cacb2e Add onHttpResponseHeaders callback. Fixes #567 2018-10-08 17:54:04 +02:00
Kristaps Grinbergs 2280423c21 Release action with fastlane 2018-10-08 18:42:48 +03:00
Kristaps Grinbergs 2022e6f553 Merge pull request #568 from daltoniam/swift_4.2
Swift 4.2 and example project
2018-10-08 18:12:31 +03:00
Kristaps Grinbergs b0729b1181 Added build.sh file 2018-10-08 18:10:25 +03:00
Kristaps Grinbergs fd8a3fc3fa Clean up example project 2018-10-08 17:59:34 +03:00
Kristaps Grinbergs f58389b4ff Remove test project as submodule 2018-10-08 17:55:36 +03:00
Kristaps Grinbergs 4b28929ae5 Swift 4.2 and example project
* Swift 4.2 support
* version bump in podspec
* example version with websockets.org echo example
* remove deprecated .swift-version
2018-10-08 17:36:51 +03:00
Kristaps Grinbergs 384b8039ef Merge pull request #559 from turbulem/pr_520
Move CommonCrypto and zlib dependencies mapping to custom module map
2018-10-08 16:57:58 +03:00
Kristaps Grinbergs c70d18f03d Merge pull request #564 from fb55/patch-1
Add pongDelegate to WebSocketClient protocol
2018-10-04 21:57:27 +03:00
Felix Böhm 813d92d917 Add pongDelegate to WebSocketClient protocol
currently blocking https://github.com/RxSwiftCommunity/RxStarscream/pull/23
2018-10-04 12:53:54 +01:00
Sergey Lem c6dfbf1ccb Update podspec, return old code for sha1, update project settings 2018-10-02 11:28:24 +01:00
Sergey Lem e22724f5cf Remove no longer needed dependencies from SPM config 2018-10-01 11:52:33 +01:00
Sergey Lem dceb95c4ea Remove custom module maps for CC and zlib, use system-provided ones 2018-10-01 11:44:36 +01:00
Sergey Lem c3b05cde30 Squashed commit of the following:
commit 467334e818
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Fri Sep 28 10:47:53 2018 +0100

    Remove old file

commit 631c25645a
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Fri Sep 28 09:51:15 2018 +0100

    Fix project settings

commit d629a65c20
Merge: 6371914 7f12731
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Wed Sep 26 14:58:20 2018 +0100

    Merge branch 'master' of github.com:turbulem/Starscream

    # Conflicts:
    #	Starscream.xcodeproj/project.pbxproj

commit 637191444a
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Mon Sep 10 09:45:21 2018 +0100

    Add NSString+SHA1 to test target

commit 33846d16f5
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Mon Sep 10 09:40:09 2018 +0100

    Fix project inclusion and add missing linker flag

commit 74e3c637e5
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Wed Jul 25 10:47:16 2018 +0100

    Pull master branch from daltoniam/Starscream

commit 912e7da6a1
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Thu Jun 28 11:30:51 2018 +0100

    Fix return type for SHA1 digest and cast warning

commit 70234bc6bb
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Mon Jun 25 13:18:18 2018 +0100

    Add custom wrapper for SHA1 and custom modulemap for framework including module maps for CommonCrypto and zlib

commit 94f8d58d0b
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Thu Jun 14 18:52:14 2018 +0100

    Move CommonCrypto and zlib dependencies mapping to private module map

commit 7f12731d14
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Mon Sep 10 09:45:21 2018 +0100

    Add NSString+SHA1 to test target

commit 8df9d1ebf9
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Mon Sep 10 09:40:09 2018 +0100

    Fix project inclusion and add missing linker flag

commit bd0732e53b
Merge: 138cfa7 70fd033
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Wed Jul 25 10:48:22 2018 +0100

    Merge branch 'master'

    # Conflicts:
    #	Starscream.xcodeproj/project.pbxproj

commit 138cfa76a3
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Wed Jul 25 10:47:16 2018 +0100

    Pull master branch from daltoniam/Starscream

commit ca783dbcae
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Thu Jun 28 11:30:51 2018 +0100

    Fix return type for SHA1 digest and cast warning

commit 8ca8df0edc
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Mon Jun 25 13:18:18 2018 +0100

    Add custom wrapper for SHA1 and custom modulemap for framework including module maps for CommonCrypto and zlib

commit 98e1d6207c
Author: Sergey Lem <lemsergey@gmail.com>
Date:   Thu Jun 14 18:52:14 2018 +0100

    Move CommonCrypto and zlib dependencies mapping to private module map
2018-09-28 13:20:22 +01:00
Dalton 79cd8a2a89 Merge pull request #556 from nuclearace/spm-4
update to swift 4 manifest
2018-09-25 10:58:35 -05:00
Erik Little a403aea07e update to swift 4 manifest 2018-09-23 09:41:41 -04:00
Dalton 70fd033db6 Merge pull request #527 from brian-dlee/master
Documents `disconnect` behavior in README
2018-07-20 16:50:59 -05:00
Dalton d2bf71599a Merge pull request #522 from MaherKSantina/master
Fixed typo in Readme
2018-07-20 16:49:59 -05:00
Dalton 09297799cc Merge pull request #507 from eliburke/master
added open keyword to SSLSecurity.isValid, added public to other methods
2018-07-20 16:48:48 -05:00
Dalton b111e1a8f0 Merge pull request #481 from MuniekMg/master
Client Side Authentication Added
2018-07-20 16:44:26 -05:00
Dalton 451480d86f Merge pull request #524 from adamkaplan/fix-crash-nil-outstream
Fix crash nil outstream
2018-07-20 16:41:39 -05:00
Brian Lee 9811225d21 Documents disconnect behavior in README 2018-06-25 15:41:34 -07:00
Adam Kaplan cfd37a6f08 Fix Xcode 10 error on unsafe access in test 2018-06-21 11:49:13 -04:00
Adam Kaplan c89a127289 Prevent a crash if Websocket output stream is gone 2018-06-21 11:45:29 -04:00
Maher Santina 6a2a3a7c36 Fixed typo 2018-06-21 18:32:03 +10:00
Maher Santina 8266c80b85 Fixed typo 2018-06-21 18:30:37 +10:00
Eli Burke d8278d951a added keyword public to SSLSecurity.certificateChain, publicKeyChain, extractPublicKey 2018-04-24 10:18:30 -04:00
Eli Burke 0f2ee9f68e change SSLSecurity.isValid from public to open 2018-04-24 09:58:53 -04:00
Tomasz Trela 8b9c52eec3 cosmetic changes to match original code 2018-04-07 19:43:02 +02:00
Tomasz Trela 073aa863cd prints changes to throw error 2018-04-07 19:39:42 +02:00
Tomasz Trela cd185b6fe9 Removed conflicts and unnecessary useSSLClientAuthentication varialbe 2018-04-07 18:50:35 +02:00
daltoniam 114e5df9b6 Merge branch 'master' of https://github.com/daltoniam/Starscream 2018-04-04 13:16:29 -05:00
daltoniam 430bfc32c3 a few small bug fixes and swift 4.1 support 2018-04-04 13:16:20 -05:00
MuniekMg 1edb4c0b65 Documantations fixed 2018-03-10 11:54:24 +01:00
MuniekMg 157291cb5e Client Side Authentication Added 2018-03-09 18:45:32 +01:00
Austin Cherry 31f522155a Merge pull request #461 from rastersize/remove-cartfile
Remove Cartfile as the checkout is unused
2018-02-19 17:22:33 -06:00
Aron Cedercrantz 327a7d8e9e Remove Cartfile as the checkout is unused 2018-01-30 18:04:11 -05:00
daltoniam 6e10c04c83 bumped spec. Updated CHANGELOG 2018-01-13 19:14:22 -06:00
daltoniam 97401e04bc Merge branch 'master' of https://github.com/daltoniam/Starscream 2018-01-13 18:56:36 -06:00
Dalton 6ba3563148 Merge pull request #452 from victorg1991/master
Enable editing Host header value
2018-01-13 18:56:27 -06:00
daltoniam 146368c71a new error handling. Timeout fix. Assorted fixes 2018-01-13 18:53:59 -06:00
Victor Galan 4ea6f4be3a Enable editing Host header value 2018-01-11 17:20:04 +01:00
daltoniam 6cb1c474e0 watchos, forgot about that one 2017-12-08 13:56:15 -06:00
daltoniam 7102d31afb watchos, forgot about that one 2017-12-08 13:53:31 -06:00
daltoniam 0f94bb3d95 spec 2017-12-08 13:46:43 -06:00
daltoniam 28070bf2a4 bumped spec 2017-12-08 13:40:21 -06:00
daltoniam ee0c7f9213 Merge branch 'master' of https://github.com/daltoniam/Starscream 2017-12-08 13:06:52 -06:00
daltoniam a49c7e2119 bug fixes 2017-12-08 13:06:50 -06:00
Dalton 7fad6b3a82 Merge pull request #438 from BlakeBarrett/patch-1
Update README.md
2017-12-08 13:04:32 -06:00
Dalton 06baac0fe7 Merge pull request #423 from neoneye/master
enableSOCKSProxy - See websocket traffic in Charles proxy
2017-12-08 13:04:16 -06:00
Blake Barrett 5866676617 Update README.md
Fix a typo in one of the code samples.
2017-12-07 16:44:04 -08:00
Simon Strandgaard b074c6c833 I was unable to see any websocket traffic in Charles proxy. In order to enable websocket inspection I applied the snippet by https://github.com/kevinmlong that is mentioned here: https://github.com/daltoniam/Starscream/issues/240 2017-11-15 15:58:36 +01:00
Dalton 8f2af31bd3 Merge pull request #418 from frederik-jacques/master
Fix warning for Swift 4 on the use of `character` property
2017-11-08 12:51:17 -06:00
Dalton d3fb769f93 Merge pull request #420 from fjcaetano/fix/deployment_target
Fix: tvOS framework deployment target
2017-11-08 12:47:36 -06:00
Flávio Caetano f58eb4ccad Fix: tvOS framework deployment target
fix #419
2017-11-07 17:35:35 -02:00
Frederik Jacques 880b5b4c9e Fix warning for Swift 4 on the use of character property 2017-11-07 09:37:00 +01:00
Dalton 97e378d94a Merge pull request #405 from hishnash/sendPong
Expose Pong Control frames
2017-11-06 12:58:32 -06:00
Dalton ca20b02ca2 Merge pull request #410 from qiuncheng/master
Fixed #409 When url contains query, server cannot get query parameters.
2017-11-06 12:57:18 -06:00
Dalton a1f133d737 Merge pull request #412 from eliburke/master
improved handling for self-signed certificate validation
2017-11-06 12:56:56 -06:00
Eli Burke 13f685f464 add flag to SSLSecurity implementation to turn off full cert chain checks. The
existing code would not work in cases where a CA cert was trusted, and the web
site used a signed leaf certificate. default behavior is unchanged
2017-10-31 11:41:41 -04:00
Eli Burke fae7ef2817 preserve original behavior when desiredTrustHostname is set to nil or "" 2017-10-23 09:45:19 -04:00
Eli Burke b24eaba135 separate self-signed from cert name override
add a 2nd method of getting the remote host domain name
2017-10-20 16:29:25 -04:00
qiuncheng e8182190b7 Fixed #409 When url contains query, server cannot get query parameters. 2017-10-17 14:22:22 +08:00
Dalton bf24825167 Merge pull request #400 from fassko/ISSUE_399
Fixes #399 String.characters.count deprecation warning in Xcode 9.1
2017-10-16 12:50:57 -05:00
Dalton 9ee57e089d Merge pull request #404 from rastersize/patch-1
Fix version number in changelog
2017-10-16 12:49:39 -05:00
Matthaus Woolard f057a8b33d Expose Pong Control frames
* Let users send Pong frames
* let users turn off automatic Ping responds with Pong. (only needed are edge cases)
2017-10-16 08:43:15 +03:00
Aron Cedercrantz b8fe0f64e3 Fix version number in changelog 2017-10-13 15:02:06 -04:00
Kristaps Grinbergs 94e54af61c Fixes #399
String.characters.count deprecation warnings
2017-10-09 16:40:15 +03:00
daltoniam 44ce58956f handle trailing slash better. bumped version 2017-10-04 21:54:22 -05:00
daltoniam c7cc1db0e3 fix for servers disliking not having a trailing slash. #394, #392 2017-10-02 13:08:10 -05:00
daltoniam a438ea1977 added armv7k 2017-09-27 15:12:41 -05:00
daltoniam b5991eda48 version update 2017-09-27 13:42:09 -05:00
Dalton 0a6f6d2a79 Merge pull request #388 from nuclearace/fix-http-headers
HTTP headers are case insensitive
2017-09-27 13:37:51 -05:00
Dalton 3fdf33a078 Merge pull request #390 from xjbeta/Fix-Deployment
Add macOS Deployment Target.
2017-09-27 13:36:04 -05:00
xjbeta 9f5f0f44f9 Add macOS Deployment Target. 2017-09-27 14:12:42 +08:00
Erik Little da7949d2da HTTP headers are case insensitive 2017-09-26 13:12:43 -04:00
Dalton dc48916804 Merge pull request #386 from lukkas/missing-arm64
add missing arm64
2017-09-26 11:51:03 -05:00
Lukasz Kasperek e0e8271725 add missing armv7 2017-09-26 15:57:04 +02:00
Lukasz Kasperek 411820d836 add missing arm64 2017-09-26 14:56:33 +02:00
daltoniam d326d448b0 pod spec update for new folder name 2017-09-25 16:29:15 -05:00
daltoniam 7dd90900dc merged the swift 4 branch 2017-09-25 16:22:33 -05:00
daltoniam f506be54ae refactor and swift4 2017-09-25 16:00:28 -05:00
Dalton 143ab16c1a Merge pull request #377 from hamchapman/two-targets-one-scheme
Reduce to two targets and a single scheme
2017-09-22 13:17:03 -05:00
Hamilton Chapman 4d281416c2 Reduce to two targets and a single scheme 2017-09-05 10:30:55 +01:00
Dalton e9d10000ec Merge pull request #372 from jcesarmobile/patch-1
Use Swift 4
2017-09-02 14:33:58 -05:00
Austin Cherry 789264eeff Merge pull request #375 from nremond/patch-1
Typo in README.md
2017-08-31 11:29:00 -05:00
Nicolas Rémond 644e8f92c0 Typo in README.md 2017-08-31 10:49:34 +02:00
jcesarmobile 68b64ede4e Use Swift 4
update .swift-version file to use Swift 4
2017-08-23 11:06:25 +02:00
daltoniam 31277a418c swift4 project file update 2017-08-19 17:23:58 -05:00
63 changed files with 2361 additions and 1453 deletions
+93 -2
View File
@@ -4,7 +4,7 @@
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control?
#
# Pods/
Pods/
# Xcode
.DS_Store
@@ -24,4 +24,95 @@ DerivedData
.idea/
*.hmap
*.xccheckout
*.xcodeproj/*.xcworkspace
*.xcodeproj/*.xcworkspace
# Created by https://www.gitignore.io/api/swift,swiftpm
### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
### SwiftPM ###
Packages
xcuserdata
*.xcodeproj
# End of https://www.gitignore.io/api/swift,swiftpm
-1
View File
@@ -1 +0,0 @@
3.0
+7
View File
@@ -0,0 +1,7 @@
osx_image: xcode10
language: objective-c
before_install:
- gem install cocoapods --pre
- gem cleanup
script:
- ./build.sh
+96
View File
@@ -2,6 +2,102 @@
All notable changes to this project will be documented in this file.
`Starscream` adheres to [Semantic Versioning](http://semver.org/).
#### [3.0.5](https://github.com/daltoniam/Starscream/tree/3.0.5)
Swift 4.1 support and bug fixes.
Pull Requests:
[#492](https://github.com/daltoniam/Starscream/pull/492)
[#461](https://github.com/daltoniam/Starscream/pull/461)
[#476](https://github.com/daltoniam/Starscream/pull/476)
Issues:
[#494](https://github.com/daltoniam/Starscream/issues/494)
[#491](https://github.com/daltoniam/Starscream/issues/491)
[#474](https://github.com/daltoniam/Starscream/issues/474)
[#471](https://github.com/daltoniam/Starscream/issues/471)
[#437](https://github.com/daltoniam/Starscream/issues/437)
[#445](https://github.com/daltoniam/Starscream/issues/445)
[#466](https://github.com/daltoniam/Starscream/issues/466)
#### [3.0.4](https://github.com/daltoniam/Starscream/tree/3.0.4)
Improved error handling. Timeout fix. Small assorted fixes.
Pull Requests:
[#452](https://github.com/daltoniam/Starscream/pull/452)
[#448](https://github.com/daltoniam/Starscream/pull/448)
[#444](https://github.com/daltoniam/Starscream/pull/444)
[#443](https://github.com/daltoniam/Starscream/pull/443)
Issues:
[#415](https://github.com/daltoniam/Starscream/issues/415)
[#422](https://github.com/daltoniam/Starscream/issues/422)
[#429](https://github.com/daltoniam/Starscream/issues/429)
[#433](https://github.com/daltoniam/Starscream/issues/433)
[#439](https://github.com/daltoniam/Starscream/issues/439)
#### [3.0.3](https://github.com/daltoniam/Starscream/tree/3.0.3)
Assorted fixes.
Pull Requests:
[#438](https://github.com/daltoniam/Starscream/pull/438)
[#423](https://github.com/daltoniam/Starscream/pull/423)
[#420](https://github.com/daltoniam/Starscream/pull/420)
[#418](https://github.com/daltoniam/Starscream/pull/418)
[#410](https://github.com/daltoniam/Starscream/pull/410)
[#405](https://github.com/daltoniam/Starscream/pull/405)
[#404](https://github.com/daltoniam/Starscream/pull/404)
[#400](https://github.com/daltoniam/Starscream/pull/400)
Issues:
[#435](https://github.com/daltoniam/Starscream/issues/435)
[#431](https://github.com/daltoniam/Starscream/issues/431)
[#426](https://github.com/daltoniam/Starscream/issues/426)
[#409](https://github.com/daltoniam/Starscream/issues/409)
[#408](https://github.com/daltoniam/Starscream/issues/408)
[#401](https://github.com/daltoniam/Starscream/issues/401)
[#399](https://github.com/daltoniam/Starscream/issues/399)
[#378](https://github.com/daltoniam/Starscream/issues/378)
#### [3.0.2](https://github.com/daltoniam/Starscream/tree/3.0.2)
Small fixes for 3.0.1.
[#394](https://github.com/daltoniam/Starscream/issues/394)
[#392](https://github.com/daltoniam/Starscream/issues/392)
[#391](https://github.com/daltoniam/Starscream/issues/391)
#### [3.0.1](https://github.com/daltoniam/Starscream/tree/3.0.1)
Small fixes for 3.0.0.
[#389](https://github.com/daltoniam/Starscream/issues/389)
[#354](https://github.com/daltoniam/Starscream/issues/354)
[#386](https://github.com/daltoniam/Starscream/pull/386)
[#388](https://github.com/daltoniam/Starscream/pull/388)
[#390](https://github.com/daltoniam/Starscream/pull/390)
#### [3.0.0](https://github.com/daltoniam/Starscream/tree/3.0.0)
Major refactor and Swift 4 support. Additions include:
- Watchos support.
- Linux support.
- New Stream class to allow custom socket implementations if desired.
- Protocol added for mocking (dependency injection).
- Single framework (no more platform suffixes! e.g. StarscreamOSX, StarscreamTVOS, etc).
[#384](https://github.com/daltoniam/Starscream/issues/384)
[#377](https://github.com/daltoniam/Starscream/pull/377)
[#374](https://github.com/daltoniam/Starscream/issues/374)
[#346](https://github.com/daltoniam/Starscream/issues/346)
[#335](https://github.com/daltoniam/Starscream/issues/335)
[#311](https://github.com/daltoniam/Starscream/pull/311)
[#269](https://github.com/daltoniam/Starscream/issues/269)
#### [2.1.1](https://github.com/daltoniam/Starscream/tree/2.1.1)
Fixes race condition. Updated to avoid SPM dependencies.
+4
View File
@@ -0,0 +1,4 @@
source "https://rubygems.org"
gem "fastlane"
gem "cocoapods", ">= 1.6.0.beta.1"
+201
View File
@@ -0,0 +1,201 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
atomos (0.1.3)
babosa (1.0.2)
claide (1.0.2)
cocoapods (1.6.0.beta.1)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.6.0.beta.1)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.2.1, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (~> 2.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.2)
xcodeproj (>= 1.6.0, < 2.0)
cocoapods-core (1.6.0.beta.1)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.1)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
concurrent-ruby (1.0.5)
declarative (0.0.10)
declarative-option (0.1.0)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.5.0)
emoji_regex (0.1.1)
escape (0.0.4)
excon (0.62.0)
faraday (0.15.3)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.4)
fastlane (2.105.2)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
bundler (>= 1.12.0, < 2.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (~> 0.1)
excon (>= 0.45.0, < 1.0.0)
faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.9)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.21.2, < 0.24.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
mini_magick (~> 4.5.1)
multi_json
multi_xml (~> 0.5)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
public_suffix (~> 2.0.0)
rubyzip (>= 1.2.2, < 2.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 1.6.2, < 2.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.6.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
google-api-client (0.23.9)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.5, < 0.7.0)
httpclient (>= 2.8.1, < 3.0)
mime-types (~> 3.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.9)
googleauth (0.6.6)
faraday (~> 0.12)
jwt (>= 1.4, < 3.0)
memoist (~> 0.12)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.7)
highline (1.7.10)
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.1.0)
jwt (2.1.0)
memoist (0.16.0)
mime-types (3.2.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mini_magick (4.5.1)
minitest (5.11.3)
molinillo (0.6.6)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.6)
nap (1.1.0)
naturally (2.2.0)
netrc (0.11.0)
os (1.0.0)
plist (3.4.0)
public_suffix (2.0.5)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rouge (2.0.7)
ruby-macho (1.3.1)
rubyzip (1.2.2)
security (0.1.3)
signet (0.10.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.5)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (1.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
tty-cursor (0.6.0)
tty-screen (0.6.5)
tty-spinner (0.8.0)
tty-cursor (>= 0.5.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.4.0)
word_wrap (1.0.0)
xcodeproj (1.6.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.2.6)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
ruby
DEPENDENCIES
cocoapods (>= 1.6.0.beta.1)
fastlane
BUNDLED WITH
1.16.1
+8
View File
@@ -0,0 +1,8 @@
{
"object": {
"pins": [
]
},
"version": 1
}
+9 -7
View File
@@ -1,3 +1,5 @@
// swift-tools-version:4.2
//
// Package.Swift
// Starscream
@@ -21,12 +23,12 @@
import PackageDescription
let package = Package(
name: "Starscream",
dependencies: [
.Package(url: "https://github.com/daltoniam/zlib-spm.git",
majorVersion: 1, minor: 1),
.Package(url: "https://github.com/daltoniam/common-crypto-spm",
majorVersion: 1, minor: 1),
name: "Starscream",
products: [
.library(name: "Starscream", targets: ["Starscream"])
],
exclude: ["Tests", "examples"]
dependencies: [],
targets: [
.target(name: "Starscream")
]
)
+57 -30
View File
@@ -1,6 +1,6 @@
![starscream](https://raw.githubusercontent.com/daltoniam/starscream/assets/starscream.jpg)
Starscream is a conforming WebSocket ([RFC 6455](http://tools.ietf.org/html/rfc6455)) client library in Swift for iOS and OSX.
Starscream is a conforming WebSocket ([RFC 6455](http://tools.ietf.org/html/rfc6455)) client library in Swift.
Its Objective-C counterpart can be found here: [Jetfire](https://github.com/acmacalister/jetfire)
@@ -35,7 +35,7 @@ After you are connected, there are some delegate methods that we need to impleme
websocketDidConnect is called as soon as the client connects to the server.
```swift
func websocketDidConnect(socket: WebSocket) {
func websocketDidConnect(socket: WebSocketClient) {
print("websocket is connected")
}
```
@@ -45,7 +45,7 @@ func websocketDidConnect(socket: WebSocket) {
websocketDidDisconnect is called as soon as the client is disconnected from the server.
```swift
func websocketDidDisconnect(socket: WebSocket, error: NSError?) {
func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {
print("websocket is disconnected: \(error?.localizedDescription)")
}
```
@@ -55,7 +55,7 @@ func websocketDidDisconnect(socket: WebSocket, error: NSError?) {
websocketDidReceiveMessage is called when the client gets a text frame from the connection.
```swift
func websocketDidReceiveMessage(socket: WebSocket, text: String) {
func websocketDidReceiveMessage(socket: WebSocketClient, text: String) {
print("got some text: \(text)")
}
```
@@ -65,7 +65,7 @@ func websocketDidReceiveMessage(socket: WebSocket, text: String) {
websocketDidReceiveData is called when the client gets a binary frame from the connection.
```swift
func websocketDidReceiveData(socket: WebSocket, data: Data) {
func websocketDidReceiveData(socket: WebSocketClient, data: Data) {
print("got some data: \(data.count)")
}
```
@@ -75,7 +75,7 @@ func websocketDidReceiveData(socket: WebSocket, data: Data) {
websocketDidReceivePong is called when the client gets a pong response from the connection. You need to implement the WebSocketPongDelegate protocol and set an additional delegate, eg: ` socket.pongDelegate = self`
```swift
func websocketDidReceivePong(socket: WebSocket, data: Data?) {
func websocketDidReceivePong(socket: WebSocketClient, data: Data?) {
print("Got pong! Maybe some data: \(data?.count)")
}
```
@@ -89,7 +89,7 @@ socket.onConnect = {
print("websocket is connected")
}
//websocketDidDisconnect
socket.onDisconnect = { (error: NSError?) in
socket.onDisconnect = { (error: Error?) in
print("websocket is disconnected: \(error?.localizedDescription)")
}
//websocketDidReceiveMessage
@@ -104,7 +104,7 @@ socket.onData = { (data: Data) in
socket.connect()
```
One more: you can listen to socket connection and disconnection via notifications. Starscream posts `WebsocketDidConnectNotification` and `WebsocketDidDisconnectNotification`. You can find an `NSError` that caused the disconection by accessing `WebsocketDisconnectionErrorKeyName` on notification `userInfo`.
One more: you can listen to socket connection and disconnection via notifications. Starscream posts `WebsocketDidConnectNotification` and `WebsocketDidDisconnectNotification`. You can find an `Error` that caused the disconection by accessing `WebsocketDisconnectionErrorKeyName` on notification `userInfo`.
## The delegate methods give you a simple way to handle data from the server, but how do you send data?
@@ -133,6 +133,25 @@ The writePing method is the same as write, but sends a ping control frame.
socket.write(ping: Data()) //example on how to write a ping control frame over the socket!
```
### write a pong frame
the writePong method is the same as writePing, but sends a pong control frame.
```swift
socket.write(pong: Data()) //example on how to write a pong control frame over the socket!
```
Starscream will automatically respond to incoming `ping` control frames so you do not need to manually send `pong`s.
However if for some reason you need to control this process you can turn off the automatic `ping` response by disabling `respondToPingWithPong`.
```swift
socket.respondToPingWithPong = false //Do not automaticaly respond to incoming pings with pongs.
```
In most cases you will not need to do this.
### disconnect
The disconnect method does what you would expect and closes the socket.
@@ -141,6 +160,12 @@ The disconnect method does what you would expect and closes the socket.
socket.disconnect()
```
The socket can be forcefully closed, by specifying a timeout (in milliseconds). A timeout of zero will also close the socket immediately without waiting on the server.
```swift
socket.disconnect(forceTimeout: 10, closeCode: CloseCode.normal.rawValue)
```
### isConnected
Returns if the socket is connected or not.
@@ -156,9 +181,12 @@ if socket.isConnected {
You can also override the default websocket headers with your own custom ones like so:
```swift
socket.headers["Sec-WebSocket-Protocol"] = "someother protocols"
socket.headers["Sec-WebSocket-Version"] = "14"
socket.headers["My-Awesome-Header"] = "Everything is Awesome!"
var request = URLRequest(url: URL(string: "ws://localhost:8080/")!)
request.timeoutInterval = 5
request.setValue("someother protocols", forHTTPHeaderField: "Sec-WebSocket-Protocol")
request.setValue("14", forHTTPHeaderField: "Sec-WebSocket-Version")
request.setValue("Everything is Awesome!", forHTTPHeaderField: "My-Awesome-Header")
let socket = WebSocket(request: request)
```
### Custom HTTP Method
@@ -166,15 +194,11 @@ socket.headers["My-Awesome-Header"] = "Everything is Awesome!"
Your server may use a different HTTP method when connecting to the websocket:
```swift
socket.httpMethod = .post
var request = URLRequest(url: URL(string: "ws://localhost:8080/")!)
request.httpMethod = "POST"
request.timeoutInterval = 5
let socket = WebSocket(request: request)
```
you can use a custom string:
```swift
socket.httpMethod = .custom(value: "mycustomhttpmethod")
```
### Protocols
@@ -262,7 +286,7 @@ To use Starscream in your project add the following 'Podfile' to your project
platform :ios, '9.0'
use_frameworks!
pod 'Starscream', '~> 2.0.3'
pod 'Starscream', '~> 3.0.2'
Then run:
@@ -284,7 +308,7 @@ $ brew install carthage
To integrate Starscream into your Xcode project using Carthage, specify it in your `Cartfile`:
```
github "daltoniam/Starscream" >= 2.0.3
github "daltoniam/Starscream" >= 3.0.2
```
### Rogue
@@ -294,7 +318,7 @@ First see the [installation docs](https://github.com/acmacalister/Rogue) for how
To install Starscream run the command below in the directory you created the rogue file.
```
rogue add https://github.com/daltoniam/starscream
rogue add https://github.com/daltoniam/Starscream
```
Next open the `libs` folder and add the `Starscream.xcodeproj` to your Xcode project. Once that is complete, in your "Build Phases" add the `Starscream.framework` to your "Link Binary with Libraries" phase. Make sure to add the `libs` folder to your `.gitignore` file.
@@ -307,7 +331,7 @@ Once you have your Swift package set up, adding Starscream as a dependency is as
```swift
dependencies: [
.Package(url: "https://github.com/daltoniam/Starscream.git", majorVersion: 2)
.Package(url: "https://github.com/daltoniam/Starscream.git", majorVersion: 3)
]
```
@@ -333,7 +357,7 @@ In most cases you do not need the extra info and should use the normal delegate.
#### websocketDidReceiveMessage
```swift
func websocketDidReceiveMessage(socket: WebSocket, text: String, response: WebSocket.WSResponse {
func websocketDidReceiveMessage(socket: WebSocketClient, text: String, response: WebSocket.WSResponse) {
print("got some text: \(text)")
print("First frame for this message arrived on \(response.firstFrame)")
}
@@ -341,7 +365,7 @@ func websocketDidReceiveMessage(socket: WebSocket, text: String, response: WebSo
#### websocketDidReceiveData
```swift
func websocketDidReceiveData(socket: WebSocket, data: Date, response: WebSocket.WSResponse) {
func websocketDidReceiveData(socket: WebSocketClient, data: Date, response: WebSocket.WSResponse) {
print("got some data it long: \(data.count)")
print("A total of \(response.frameCount) frames were used to send this data")
}
@@ -350,22 +374,25 @@ func websocketDidReceiveData(socket: WebSocket, data: Date, response: WebSocket.
#### websocketHttpUpgrade
These methods are called when the HTTP upgrade request is sent and when the response returns.
```swift
func websocketHttpUpgrade(socket: WebSocket, request: CFHTTPMessage) {
func websocketHttpUpgrade(socket: WebSocketClient, request: CFHTTPMessage) {
print("the http request was sent we can check the raw http if we need to")
}
```
```swift
func websocketHttpUpgrade(socket: WebSocket, response: CFHTTPMessage) {
func websocketHttpUpgrade(socket: WebSocketClient, response: CFHTTPMessage) {
print("the http response has returned.")
}
```
## KNOWN ISSUES
- WatchOS does not have the the CFNetwork String constants to modify the stream's SSL behavior. It will be the default Foundation SSL behavior. This means watchOS CANNOT use `SSLCiphers`, `disableSSLCertValidation`, or SSL pinning. All these values set on watchOS will do nothing.
- Linux does not have the security framework, so it CANNOT use SSL pinning or `SSLCiphers` either.
## TODOs
- [ ] WatchOS?
- [ ] Linux Support?
- [ ] Add Unit Tests - Local Swift websocket server
- [ ] Add Unit Tests - Local WebSocket server that runs against Autobahn
## License
-30
View File
@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
</dict>
</plist>
+1 -1
View File
@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.1</string>
<string>3.0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@@ -27,7 +27,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////
import Foundation
import SSCZLib
import zlib
class Decompressor {
private var strm = z_stream()
@@ -52,7 +52,7 @@ class Decompressor {
func reset() throws {
teardownInflate()
guard initInflate() else { throw NSError() }
guard initInflate() else { throw WSError(type: .compressionError, message: "Error for decompressor on reset", code: 0) }
}
func decompress(_ data: Data, finish: Bool) throws -> Data {
@@ -92,7 +92,7 @@ class Decompressor {
guard (res == Z_OK && strm.avail_out > 0)
|| (res == Z_BUF_ERROR && Int(strm.avail_out) == buffer.count)
else {
throw NSError(domain: WebSocket.ErrorDomain, code: Int(WebSocket.InternalErrorCode.compressionError.rawValue), userInfo: nil)
throw WSError(type: .compressionError, message: "Error on decompressing", code: 0)
}
}
@@ -131,7 +131,7 @@ class Compressor {
func reset() throws {
teardownDeflate()
guard initDeflate() else { throw NSError() }
guard initDeflate() else { throw WSError(type: .compressionError, message: "Error for compressor on reset", code: 0) }
}
func compress(_ data: Data) throws -> Data {
@@ -157,7 +157,7 @@ class Compressor {
guard res == Z_OK && strm.avail_out > 0
|| (res == Z_BUF_ERROR && Int(strm.avail_out) == buffer.count)
else {
throw NSError(domain: WebSocket.ErrorDomain, code: Int(WebSocket.InternalErrorCode.compressionError.rawValue), userInfo: nil)
throw WSError(type: .compressionError, message: "Error on compressing", code: 0)
}
compressed.removeLast(4)
@@ -0,0 +1,92 @@
//
// SSLClientCertificate.swift
// Starscream
//
// Created by Tomasz Trela on 08/03/2018.
// Copyright © 2018 Vluxe. All rights reserved.
//
import Foundation
public struct SSLClientCertificateError: LocalizedError {
public var errorDescription: String?
init(errorDescription: String) {
self.errorDescription = errorDescription
}
}
public class SSLClientCertificate {
internal let streamSSLCertificates: NSArray
/**
Convenience init.
- parameter pkcs12Path: Path to pkcs12 file containing private key and X.509 ceritifacte (.p12)
- parameter password: file password, see **kSecImportExportPassphrase**
*/
public convenience init(pkcs12Path: String, password: String) throws {
let pkcs12Url = URL(fileURLWithPath: pkcs12Path)
do {
try self.init(pkcs12Url: pkcs12Url, password: password)
} catch {
throw error
}
}
/**
Designated init. For more information, see SSLSetCertificate() in Security/SecureTransport.h.
- parameter identity: SecIdentityRef, see **kCFStreamSSLCertificates**
- parameter identityCertificate: CFArray of SecCertificateRefs, see **kCFStreamSSLCertificates**
*/
public init(identity: SecIdentity, identityCertificate: SecCertificate) {
self.streamSSLCertificates = NSArray(objects: identity, identityCertificate)
}
/**
Convenience init.
- parameter pkcs12Url: URL to pkcs12 file containing private key and X.509 ceritifacte (.p12)
- parameter password: file password, see **kSecImportExportPassphrase**
*/
public convenience init(pkcs12Url: URL, password: String) throws {
let importOptions = [kSecImportExportPassphrase as String : password] as CFDictionary
do {
try self.init(pkcs12Url: pkcs12Url, importOptions: importOptions)
} catch {
throw error
}
}
/**
Designated init.
- parameter pkcs12Url: URL to pkcs12 file containing private key and X.509 ceritifacte (.p12)
- parameter importOptions: A dictionary containing import options. A
kSecImportExportPassphrase entry is required at minimum. Only password-based
PKCS12 blobs are currently supported. See **SecImportExport.h**
*/
public init(pkcs12Url: URL, importOptions: CFDictionary) throws {
do {
let pkcs12Data = try Data(contentsOf: pkcs12Url)
var rawIdentitiesAndCertificates: CFArray?
let pkcs12CFData: CFData = pkcs12Data as CFData
let importStatus = SecPKCS12Import(pkcs12CFData, importOptions, &rawIdentitiesAndCertificates)
guard importStatus == errSecSuccess else {
throw SSLClientCertificateError(errorDescription: "(Starscream) Error during 'SecPKCS12Import', see 'SecBase.h' - OSStatus: \(importStatus)")
}
guard let identitiyAndCertificate = (rawIdentitiesAndCertificates as? Array<Dictionary<String, Any>>)?.first else {
throw SSLClientCertificateError(errorDescription: "(Starscream) Error - PKCS12 file is empty")
}
let identity = identitiyAndCertificate[kSecImportItemIdentity as String] as! SecIdentity
var identityCertificate: SecCertificate?
let copyStatus = SecIdentityCopyCertificate(identity, &identityCertificate)
guard copyStatus == errSecSuccess else {
throw SSLClientCertificateError(errorDescription: "(Starscream) Error during 'SecIdentityCopyCertificate', see 'SecBase.h' - OSStatus: \(copyStatus)")
}
self.streamSSLCertificates = NSArray(objects: identity, identityCertificate!)
} catch {
throw error
}
}
}
@@ -19,7 +19,8 @@
// limitations under the License.
//
//////////////////////////////////////////////////////////////////////////////////////////////////
#if os(Linux)
#else
import Foundation
import Security
@@ -56,7 +57,8 @@ open class SSLCert {
open class SSLSecurity : SSLTrustValidator {
public var validatedDN = true //should the domain name be validated?
public var validateEntireChain = true //should the entire cert chain be validated
var isReady = false //is the key processing done?
var certificates: [Data]? //the certificates
var pubKeys: [SecKey]? //the public keys
@@ -131,7 +133,7 @@ open class SSLSecurity : SSLTrustValidator {
- returns: if the key was successfully validated
*/
public func isValid(_ trust: SecTrust, domain: String?) -> Bool {
open func isValid(_ trust: SecTrust, domain: String?) -> Bool {
var tries = 0
while !self.isReady {
@@ -169,6 +171,9 @@ open class SSLSecurity : SSLTrustValidator {
var result: SecTrustResultType = .unspecified
SecTrustEvaluate(trust,&result)
if result == .unspecified || result == .proceed {
if !validateEntireChain {
return true
}
var trustedCount = 0
for serverCert in serverCerts {
for cert in certs {
@@ -193,7 +198,7 @@ open class SSLSecurity : SSLTrustValidator {
- returns: a public key
*/
func extractPublicKey(_ data: Data) -> SecKey? {
public func extractPublicKey(_ data: Data) -> SecKey? {
guard let cert = SecCertificateCreateWithData(nil, data as CFData) else { return nil }
return extractPublicKey(cert, policy: SecPolicyCreateBasicX509())
@@ -206,7 +211,7 @@ open class SSLSecurity : SSLTrustValidator {
- returns: a public key
*/
func extractPublicKey(_ cert: SecCertificate, policy: SecPolicy) -> SecKey? {
public func extractPublicKey(_ cert: SecCertificate, policy: SecPolicy) -> SecKey? {
var possibleTrust: SecTrust?
SecTrustCreateWithCertificates(cert, policy, &possibleTrust)
@@ -223,7 +228,7 @@ open class SSLSecurity : SSLTrustValidator {
- returns: the certificate chain for the trust
*/
func certificateChain(_ trust: SecTrust) -> [Data] {
public func certificateChain(_ trust: SecTrust) -> [Data] {
let certificates = (0..<SecTrustGetCertificateCount(trust)).reduce([Data]()) { (certificates: [Data], index: Int) -> [Data] in
var certificates = certificates
let cert = SecTrustGetCertificateAtIndex(trust, index)
@@ -241,7 +246,7 @@ open class SSLSecurity : SSLTrustValidator {
- returns: the public keys from the certifcate chain for the trust
*/
func publicKeyChain(_ trust: SecTrust) -> [SecKey] {
public func publicKeyChain(_ trust: SecTrust) -> [SecKey] {
let policy = SecPolicyCreateBasicX509()
let keys = (0..<SecTrustGetCertificateCount(trust)).reduce([SecKey]()) { (keys: [SecKey], index: Int) -> [SecKey] in
var keys = keys
@@ -258,3 +263,4 @@ open class SSLSecurity : SSLTrustValidator {
}
#endif
File diff suppressed because it is too large Load Diff
+5 -9
View File
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "Starscream"
s.version = "2.1.1"
s.summary = "A conforming WebSocket RFC 6455 client library in Swift for iOS and OSX."
s.version = "3.0.6"
s.summary = "A conforming WebSocket RFC 6455 client library in Swift."
s.homepage = "https://github.com/daltoniam/Starscream"
s.license = 'Apache License, Version 2.0'
s.author = {'Dalton Cherry' => 'http://daltoniam.com', 'Austin Cherry' => 'http://austincherry.me'}
@@ -10,11 +10,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.source_files = 'Source/*.swift'
s.requires_arc = 'true'
s.libraries = 'z'
s.pod_target_xcconfig = {
'SWIFT_INCLUDE_PATHS' => '$(PODS_ROOT)/Starscream/zlib'
}
s.preserve_paths = 'zlib/*'
s.watchos.deployment_target = '2.0'
s.source_files = 'Sources/**/*.swift'
s.swift_version = '4.2'
end
File diff suppressed because it is too large Load Diff
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
version = "1.3">
LastUpgradeVersion = "0900"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
@@ -14,9 +14,9 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B3E79E519D48B7F006071F7"
BlueprintIdentifier = "33CCF0841F5DDC030099B092"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream iOS"
BlueprintName = "Starscream"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@@ -26,9 +26,34 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "335FA1F41F5DF71D00F6D2EC"
BuildableName = "Starscream Tests.xctest"
BlueprintName = "Starscream Tests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
<LocationScenarioReference
identifier = "com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier"
referenceType = "1">
</LocationScenarioReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CCF0841F5DDC030099B092"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
@@ -36,6 +61,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -45,9 +71,9 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B3E79E519D48B7F006071F7"
BlueprintIdentifier = "33CCF0841F5DDC030099B092"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream iOS"
BlueprintName = "Starscream"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
@@ -63,9 +89,9 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B3E79E519D48B7F006071F7"
BlueprintIdentifier = "33CCF0841F5DDC030099B092"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream iOS"
BlueprintName = "Starscream"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
@@ -1,113 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D9C3E35E19E48FF1009FC285"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream OSX"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D9C3E36819E48FF1009FC285"
BuildableName = "Starscream OSXTests.xctest"
BlueprintName = "Starscream OSXTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D9C3E36819E48FF1009FC285"
BuildableName = "Starscream OSXTests.xctest"
BlueprintName = "Starscream OSXTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D9C3E35E19E48FF1009FC285"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream OSX"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D9C3E35E19E48FF1009FC285"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream OSX"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D9C3E35E19E48FF1009FC285"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream OSX"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B3E79F019D48B7F006071F7"
BuildableName = "Starscream iOSTests.xctest"
BlueprintName = "Starscream iOSTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B3E79F019D48B7F006071F7"
BuildableName = "Starscream iOSTests.xctest"
BlueprintName = "Starscream iOSTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B3E79F019D48B7F006071F7"
BuildableName = "Starscream iOSTests.xctest"
BlueprintName = "Starscream iOSTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B3E79F019D48B7F006071F7"
BuildableName = "Starscream iOSTests.xctest"
BlueprintName = "Starscream iOSTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6B3E79F019D48B7F006071F7"
BuildableName = "Starscream iOSTests.xctest"
BlueprintName = "Starscream iOSTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,113 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "091277961BD673A70003036D"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream tvOS"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0912779F1BD673A70003036D"
BuildableName = "Starscream tvOSTests.xctest"
BlueprintName = "Starscream tvOSTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0912779F1BD673A70003036D"
BuildableName = "Starscream tvOSTests.xctest"
BlueprintName = "Starscream tvOSTests"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "091277961BD673A70003036D"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream tvOS"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "091277961BD673A70003036D"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream tvOS"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "091277961BD673A70003036D"
BuildableName = "Starscream.framework"
BlueprintName = "Starscream tvOS"
ReferencedContainer = "container:Starscream.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+3 -1
View File
@@ -20,6 +20,7 @@
//////////////////////////////////////////////////////////////////////////////////////////////////
import XCTest
@testable import Starscream
class CompressionTests: XCTestCase {
@@ -52,8 +53,9 @@ class CompressionTests: XCTestCase {
// 2 Gigs!
// var rawData = Data(repeating: 0, count: 0x80000000)
var rawData = Data(repeating: 0, count: 0x80000)
let rawDataLen = rawData.count
rawData.withUnsafeMutableBytes { (ptr: UnsafeMutablePointer<UInt8>) -> Void in
arc4random_buf(ptr, rawData.count)
arc4random_buf(ptr, rawDataLen)
}
let compressed = try! compressor.compress(rawData)
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
set -o pipefail && xcodebuild -project Starscream.xcodeproj -scheme Starscream CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO clean build | xcpretty
swift build
pod repo update
pod lib lint --verbose
@@ -34,7 +34,7 @@ class ViewController: UIViewController {
self?.caseCount = c
}
}
s.onDisconnect = { [weak self, weak s] (error: NSError?) in
s.onDisconnect = { [weak self, weak s] (error: Error?) in
self?.getTestInfo(1)
self?.removeSocket(s)
}
@@ -62,7 +62,7 @@ class ViewController: UIViewController {
}
var once = false
s.onDisconnect = { [weak self, weak s] (error: NSError?) in
s.onDisconnect = { [weak self, weak s] (error: Error?) in
if !once {
once = true
self?.runTest(caseNum)
@@ -82,11 +82,18 @@ class ViewController: UIViewController {
s?.write(data: data)
}
var once = false
s.onDisconnect = {[weak self, weak s] (error: NSError?) in
s.onDisconnect = {[weak self, weak s] (error: Error?) in
if !once {
once = true
print("case:\(caseNum) finished")
self?.verifyTest(caseNum)
//self?.verifyTest(caseNum) //disabled since it slows down the tests
let nextCase = caseNum+1
if nextCase <= (self?.caseCount)! {
self?.runTest(nextCase)
//self?.getTestInfo(nextCase) //disabled since it slows down the tests
} else {
self?.finishReports()
}
self?.removeSocket(s)
}
}
@@ -115,10 +122,11 @@ class ViewController: UIViewController {
}
}
var once = false
s.onDisconnect = { [weak self, weak s] (error: NSError?) in
s.onDisconnect = { [weak self, weak s] (error: Error?) in
if !once {
once = true
let nextCase = caseNum+1
print("next test is: \(nextCase)")
if nextCase <= (self?.caseCount)! {
self?.getTestInfo(nextCase)
} else {
@@ -133,7 +141,7 @@ class ViewController: UIViewController {
func finishReports() {
let s = createSocket("updateReports",0)
self.socketArray.append(s)
s.onDisconnect = { [weak self, weak s] (error: NSError?) in
s.onDisconnect = { [weak self, weak s] (error: Error?) in
print("finished all the tests!")
self?.removeSocket(s)
}
@@ -145,7 +145,7 @@
6B3E7A0E19D48D00006071F7 /* Starscream.framework */,
6B3E7A1019D48D00006071F7 /* Starscream iOSTests.xctest */,
5C06AE8B1B08044600D41060 /* Starscream.framework */,
5C06AE8D1B08044600D41060 /* StarscreamOSXTests.xctest */,
5C06AE8D1B08044600D41060 /* Starscream OSXTests.xctest */,
5C42C3E11D8F31DC00947AA2 /* Starscream.framework */,
5C42C3E31D8F31DC00947AA2 /* Starscream tvOSTests.xctest */,
);
@@ -181,7 +181,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = vluxe;
TargetAttributes = {
5C765ADA199A6DAA003D9110 = {
@@ -311,14 +311,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -358,14 +364,20 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -399,7 +411,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.vluxe.io.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -412,7 +424,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.vluxe.io.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -40,6 +40,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -69,6 +70,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -10,33 +10,38 @@ import UIKit
import Starscream
class ViewController: UIViewController, WebSocketDelegate {
var socket = WebSocket(url: URL(string: "ws://localhost:8080/")!, protocols: ["chat", "superchat"])
var socket: WebSocket!
override func viewDidLoad() {
super.viewDidLoad()
var request = URLRequest(url: URL(string: "http://localhost:8080")!)
request.timeoutInterval = 5
socket = WebSocket(request: request)
socket.delegate = self
socket.connect()
}
// MARK: Websocket Delegate Methods.
func websocketDidConnect(socket: WebSocket) {
func websocketDidConnect(socket: WebSocketClient) {
print("websocket is connected")
}
func websocketDidDisconnect(socket: WebSocket, error: NSError?) {
if let e = error {
func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {
if let e = error as? WSError {
print("websocket is disconnected: \(e.message)")
} else if let e = error {
print("websocket is disconnected: \(e.localizedDescription)")
} else {
print("websocket disconnected")
}
}
func websocketDidReceiveMessage(socket: WebSocket, text: String) {
func websocketDidReceiveMessage(socket: WebSocketClient, text: String) {
print("Received text: \(text)")
}
func websocketDidReceiveData(socket: WebSocket, data: Data) {
func websocketDidReceiveData(socket: WebSocketClient, data: Data) {
print("Received data: \(data.count)")
}
+11
View File
@@ -0,0 +1,11 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'WebSocketsOrgEcho' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for WebSocketsOrgEcho
pod 'Starscream', :path => '../../'
end
+16
View File
@@ -0,0 +1,16 @@
PODS:
- Starscream (3.0.6)
DEPENDENCIES:
- Starscream (from `../../`)
EXTERNAL SOURCES:
Starscream:
:path: "../../"
SPEC CHECKSUMS:
Starscream: 96cd79a6b7ef6a2ff2d00638c73bd195a5322586
PODFILE CHECKSUM: 96d91933fe13671aaa81af8a8675ff7698068845
COCOAPODS: 1.6.0.beta.1
@@ -0,0 +1,24 @@
{
"name": "Starscream",
"version": "3.0.6",
"summary": "A conforming WebSocket RFC 6455 client library in Swift.",
"homepage": "https://github.com/daltoniam/Starscream",
"license": "Apache License, Version 2.0",
"authors": {
"Dalton Cherry": "http://daltoniam.com",
"Austin Cherry": "http://austincherry.me"
},
"source": {
"git": "https://github.com/daltoniam/Starscream.git",
"tag": "3.0.6"
},
"social_media_url": "http://twitter.com/daltoniam",
"platforms": {
"ios": "8.0",
"osx": "10.10",
"tvos": "9.0",
"watchos": "2.0"
},
"source_files": "Sources/**/*.swift",
"swift_version": "4.2"
}
+16
View File
@@ -0,0 +1,16 @@
PODS:
- Starscream (3.0.6)
DEPENDENCIES:
- Starscream (from `../../`)
EXTERNAL SOURCES:
Starscream:
:path: "../../"
SPEC CHECKSUMS:
Starscream: 96cd79a6b7ef6a2ff2d00638c73bd195a5322586
PODFILE CHECKSUM: 96d91933fe13671aaa81af8a8675ff7698068845
COCOAPODS: 1.6.0.beta.1
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -0,0 +1,182 @@
# Acknowledgements
This application makes use of the following third party libraries:
## Starscream
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Copyright (c) 2014-2016 Dalton Cherry.
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
Generated by CocoaPods - https://cocoapods.org
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<string></string>
</plist>
@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_WebSocketsOrgEcho : NSObject
@end
@implementation PodsDummy_Pods_WebSocketsOrgEcho
@end
@@ -0,0 +1,158 @@
#!/bin/sh
set -e
set -u
set -o pipefail
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
elif [ -L "${binary}" ]; then
echo "Destination binary is symlinked..."
dirname="$(dirname "${binary}")"
binary="${dirname}/$(readlink "${binary}")"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Copies and strips a vendored dSYM
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identity
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
fi
echo "$code_sign_cmd"
eval "$code_sign_cmd"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
stripped=""
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/Starscream/Starscream.framework"
fi
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
wait
fi
@@ -0,0 +1,16 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_WebSocketsOrgEchoVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_WebSocketsOrgEchoVersionString[];
@@ -0,0 +1,11 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Starscream"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Starscream"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
@@ -0,0 +1,6 @@
framework module Pods_WebSocketsOrgEcho {
umbrella header "Pods-WebSocketsOrgEcho-umbrella.h"
export *
module * { export * }
}
@@ -0,0 +1,11 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Starscream"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Starscream/Starscream.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "Starscream"
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.0.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -0,0 +1,5 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Starscream : NSObject
@end
@implementation PodsDummy_Starscream
@end
@@ -0,0 +1,12 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
@@ -0,0 +1,16 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double StarscreamVersionNumber;
FOUNDATION_EXPORT const unsigned char StarscreamVersionString[];
@@ -0,0 +1,6 @@
framework module Starscream {
umbrella header "Starscream-umbrella.h"
export *
module * { export * }
}
@@ -0,0 +1,9 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Starscream
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../..
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:WebSocketsOrgEcho.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,21 @@
//
// AppDelegate.swift
// WebSocketsOrgEcho
//
// Created by Kristaps Grinbergs on 08/10/2018.
// Copyright © 2018 Starscream. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}
}
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="WebSocketsOrgEcho" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ysb-Wt-xJQ">
<rect key="frame" x="158" y="318.5" width="59" height="30"/>
<state key="normal" title="Connect"/>
<connections>
<action selector="connect:" destination="BYZ-38-t0r" eventType="touchUpInside" id="JK8-oU-5uC"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="ysb-Wt-xJQ" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="2YK-eB-LZR"/>
<constraint firstItem="ysb-Wt-xJQ" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="iGG-QS-5FX"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
@@ -0,0 +1,19 @@
//
// URL+Extensions.swift
// Example
//
// Created by Kristaps Grinbergs on 08/10/2018.
// Copyright © 2018 Kristaps Grinbergs. All rights reserved.
//
import Foundation
extension URL {
init(staticString string: StaticString) {
guard let url = URL(string: "\(string)") else {
preconditionFailure("Invalid static URL string: \(string)")
}
self = url
}
}
@@ -0,0 +1,42 @@
//
// ViewController.swift
// WebSocketsOrgEcho
//
// Created by Kristaps Grinbergs on 08/10/2018.
// Copyright © 2018 Starscream. All rights reserved.
//
import UIKit
import Starscream
class ViewController: UIViewController, WebSocketDelegate {
var socket: WebSocket = WebSocket(url: URL(staticString: "wss://echo.websocket.org"))
func websocketDidConnect(socket: WebSocketClient) {
print("websocketDidConnect")
}
func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {
print("websocketDidDisconnect", error ?? "")
}
func websocketDidReceiveMessage(socket: WebSocketClient, text: String) {
print("websocketDidReceiveMessage", text)
}
func websocketDidReceiveData(socket: WebSocketClient, data: Data) {
print("websocketDidReceiveData", data)
}
override func viewDidLoad() {
super.viewDidLoad()
socket.delegate = self
}
@IBAction func connect(_ sender: Any) {
socket.connect()
}
}
+28
View File
@@ -0,0 +1,28 @@
default_platform(:ios)
update_fastlane
platform :ios do
desc "Depoy new version"
lane :release do
ensure_git_branch
version = version_get_podspec(path: "Starscream.podspec")
changelog = prompt(text: "Changelog: ", multi_line_end_keyword: "END")
github_token = ENV['GITHUB_TOKEN']
if !github_token || github_token.empty?
github_token = prompt(text: "Please enter your GitHub token: ")
end
github_release = set_github_release(
repository_name: "daltoniam/Starscream",
api_token: github_token,
name: version,
tag_name: version,
description: changelog,
commitish: "master"
)
sh("git fetch --tags")
pod_push(allow_warnings: true, verbose: true)
end
end
+29
View File
@@ -0,0 +1,29 @@
fastlane documentation
================
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
```
xcode-select --install
```
Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew cask install fastlane`
# Available Actions
## iOS
### ios release
```
fastlane ios release
```
Depoy new version
----
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
bundle install
bundle exec fastlane release
-2
View File
@@ -1,2 +0,0 @@
#include <zlib.h>
#include <CommonCrypto/CommonCrypto.h>
-9
View File
@@ -1,9 +0,0 @@
module SSCZLib [system] {
header "include.h"
link "z"
export *
}
module SSCommonCrypto [system] {
header "include.h"
export *
}