Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: socketio/socket.io-client-swift
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.4.1
Choose a base ref
...
head repository: socketio/socket.io-client-swift
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 36,953 additions and 2,758 deletions.
  1. +19 −0 .github/workflows/swift.yml
  2. +54 −0 .gitignore
  3. +7 −0 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
  4. +104 −0 CHANGELOG.md
  5. +1 −0 Cartfile
  6. +1 −0 Cartfile.resolved
  7. +16 −0 Package.resolved
  8. +17 −0 Package.swift
  9. +97 −117 README.md
  10. +21 −9 Socket.IO-Client-Swift.podspec
  11. +965 −0 Socket.IO-Client-Swift.xcodeproj/project.pbxproj
  12. +7 −0 Socket.IO-Client-Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  13. +113 −0 Socket.IO-Client-Swift.xcodeproj/xcshareddata/xcschemes/SocketIO.xcscheme
  14. +26 −0 SocketIO/Info.plist
  15. +19 −0 SocketIO/SocketIO.h
  16. +146 −0 Source/SocketIO/Ack/SocketAckEmitter.swift
  17. +88 −0 Source/SocketIO/Ack/SocketAckManager.swift
  18. +25 −18 SwiftIO/SocketEngineClient.swift → Source/SocketIO/Client/SocketAnyEvent.swift
  19. +22 −25 {SwiftIO → Source/SocketIO/Client}/SocketEventHandler.swift
  20. +549 −0 Source/SocketIO/Client/SocketIOClient.swift
  21. +138 −0 Source/SocketIO/Client/SocketIOClientConfiguration.swift
  22. +241 −0 Source/SocketIO/Client/SocketIOClientOption.swift
  23. +392 −0 Source/SocketIO/Client/SocketIOClientSpec.swift
  24. +59 −0 Source/SocketIO/Client/SocketIOStatus.swift
  25. +163 −0 Source/SocketIO/Client/SocketRawView.swift
  26. +778 −0 Source/SocketIO/Engine/SocketEngine.swift
  27. +73 −0 Source/SocketIO/Engine/SocketEngineClient.swift
  28. +26 −13 SwiftIO/SocketFixUTF8.swift → Source/SocketIO/Engine/SocketEnginePacketType.swift
  29. +262 −0 Source/SocketIO/Engine/SocketEnginePollable.swift
  30. +209 −0 Source/SocketIO/Engine/SocketEngineSpec.swift
  31. +87 −0 Source/SocketIO/Engine/SocketEngineWebsocket.swift
  32. +613 −0 Source/SocketIO/Manager/SocketManager.swift
  33. +148 −0 Source/SocketIO/Manager/SocketManagerSpec.swift
  34. +250 −0 Source/SocketIO/Parse/SocketPacket.swift
  35. +181 −0 Source/SocketIO/Parse/SocketParsable.swift
  36. +132 −0 Source/SocketIO/Util/SocketExtensions.swift
  37. +75 −0 Source/SocketIO/Util/SocketLogger.swift
  38. +73 −0 Source/SocketIO/Util/SocketStringReader.swift
  39. +86 −0 Source/SocketIO/Util/SocketTypes.swift
  40. +0 −69 SwiftIO/SocketAckHandler.swift
  41. +0 −616 SwiftIO/SocketEngine.swift
  42. +0 −474 SwiftIO/SocketIOClient.swift
  43. +0 −236 SwiftIO/SocketPacket.swift
  44. +0 −258 SwiftIO/SocketParser.swift
  45. +0 −209 SwiftIO/SwiftRegex.swift
  46. +0 −714 SwiftIO/WebSocket.swift
  47. +50 −0 Tests/TestSocketIO/SocketAckManagerTest.swift
  48. +215 −0 Tests/TestSocketIO/SocketBasicPacketTest.swift
  49. +229 −0 Tests/TestSocketIO/SocketEngineTest.swift
  50. +46 −0 Tests/TestSocketIO/SocketIOClientConfigurationTest.swift
  51. +247 −0 Tests/TestSocketIO/SocketMangerTest.swift
  52. +206 −0 Tests/TestSocketIO/SocketNamespacePacketTest.swift
  53. +147 −0 Tests/TestSocketIO/SocketParserTest.swift
  54. +507 −0 Tests/TestSocketIO/SocketSideEffectTest.swift
  55. +13 −0 Tests/TestSocketIO/utils.swift
  56. +109 −0 Usage Docs/12to13.md
  57. +35 −0 Usage Docs/15to16.md
  58. +61 −0 Usage Docs/Compatibility.md
  59. +44 −0 Usage Docs/FAQ.md
  60. +335 −0 docs/12to13.html
  61. +255 −0 docs/15to16.html
  62. +526 −0 docs/Classes.html
  63. +337 −0 docs/Classes/OnAckCallback.html
  64. +436 −0 docs/Classes/SSLSecurity.html
  65. +518 −0 docs/Classes/SocketAckEmitter.html
  66. +354 −0 docs/Classes/SocketAnyEvent.html
  67. +472 −0 docs/Classes/SocketClientManager.html
  68. +1,640 −0 docs/Classes/SocketEngine.html
  69. +1,856 −0 docs/Classes/SocketIOClient.html
  70. +1,738 −0 docs/Classes/SocketManager.html
  71. +362 −0 docs/Classes/SocketRawAckView.html
  72. +532 −0 docs/Classes/SocketRawView.html
  73. +453 −0 docs/Enums.html
  74. +352 −0 docs/Enums/SocketAckStatus.html
  75. +572 −0 docs/Enums/SocketClientEvent.html
  76. +452 −0 docs/Enums/SocketEnginePacketType.html
  77. +976 −0 docs/Enums/SocketIOClientOption.html
  78. +316 −0 docs/Enums/SocketIOClientStatus.html
  79. +449 −0 docs/Enums/SocketIOStatus.html
  80. +316 −0 docs/Enums/SocketIOVersion.html
  81. +352 −0 docs/Enums/SocketParsableError.html
  82. +567 −0 docs/Extensions.html
  83. +282 −0 docs/Guides.html
  84. +593 −0 docs/Protocols.html
  85. +317 −0 docs/Protocols/ConfigSettable.html
  86. +319 −0 docs/Protocols/SocketData.html
  87. +303 −0 docs/Protocols/SocketDataBufferable.html
  88. +656 −0 docs/Protocols/SocketEngineClient.html
  89. +583 −0 docs/Protocols/SocketEnginePollable.html
  90. +1,242 −0 docs/Protocols/SocketEngineSpec.html
  91. +408 −0 docs/Protocols/SocketEngineWebsocket.html
  92. +1,802 −0 docs/Protocols/SocketIOClientSpec.html
  93. +467 −0 docs/Protocols/SocketLogger.html
  94. +1,070 −0 docs/Protocols/SocketManagerSpec.html
  95. +502 −0 docs/Protocols/SocketParsable.html
  96. +339 −0 docs/Structs.html
  97. +435 −0 docs/Structs/SocketEventHandler.html
  98. +770 −0 docs/Structs/SocketIOClientConfiguration.html
  99. +558 −0 docs/Structs/SocketPacket.html
  100. +500 −0 docs/Structs/SocketPacket/PacketType.html
  101. +336 −0 docs/Typealiases.html
  102. +28 −0 docs/badge.svg
  103. +200 −0 docs/css/highlight.css
  104. +395 −0 docs/css/jazzy.css
  105. +284 −0 docs/faq.html
  106. BIN docs/img/carat.png
  107. BIN docs/img/dash.png
  108. BIN docs/img/gh.png
  109. BIN docs/img/spinner.gif
  110. +363 −0 docs/index.html
  111. +70 −0 docs/js/jazzy.js
  112. +70 −0 docs/js/jazzy.search.js
  113. +2 −0 docs/js/jquery.min.js
  114. +6 −0 docs/js/lunr.min.js
  115. +1,694 −0 docs/js/typeahead.jquery.js
  116. +1 −0 docs/search.json
19 changes: 19 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Swift

on:
push:
branches: [ "master", "development" ]
pull_request:
branches: [ "master", "development" ]

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
54 changes: 54 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.DS_Store
.AppleDouble
.LSOverride
*.xcodeproj
.build/*
Packages/*

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

Socket.IO-Test-Server/node_modules/*

.idea/
docs/docsets/
docs/undocumented.json

.swiftpm
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

104 changes: 104 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# v16.1.0

- Remove support for iOS 11.
- Update to Starscream 4.0.6

# v16.0.0

- Removed Objective-C support. It's time for you to embrace Swift.
- Socket.io 3 support.

# v15.3.0

- Add `==` operators for `SocketAckStatus` and `String`

# v15.2.0

- Small fixes.

# v15.1.0

- Add ability to enable websockets SOCKS proxy.
- Fix emit completion callback not firing on websockets [#1178](https://github.com/socketio/socket.io-client-swift/issues/1178)

# v15.0.0

- Swift 5

# v14.0.0

- Minimum version of the client is now Swift 4.2.
- Add exponential backoff for reconnects, with `reconnectWaitMax` and `randomizationFactor` options [#1149](https://github.com/socketio/socket.io-client-swift/pull/1149)
- `statusChange` event's data format adds a second value, the raw value of the status. This is for use in Objective-C. [#1147](https://github.com/socketio/socket.io-client-swift/issues/1147)

# v13.4.0

- Add emits with write completion handlers. [#1096](https://github.com/socketio/socket.io-client-swift/issues/1096)
- Add ability to listen for when a websocket upgrade happens

# v13.3.1

- Fixes various bugs. [#857](https://github.com/socketio/socket.io-client-swift/issues/857), [#1078](https://github.com/socketio/socket.io-client-swift/issues/1078)

# v13.3.0

- Copy cookies from polling to WebSockets ([#1057](https://github.com/socketio/socket.io-client-swift/issues/1057), [#1058](https://github.com/socketio/socket.io-client-swift/issues/1058))

# v13.2.1

- Fix packets getting lost when WebSocket upgrade fails. [#1033](https://github.com/socketio/socket.io-client-swift/issues/1033)
- Fix bad unit tests. [#794](https://github.com/socketio/socket.io-client-swift/issues/794)

# v13.2.0

- Add ability to bypass Data inspection in emits. [#992]((https://github.com/socketio/socket.io-client-swift/issues/992))
- Allow `SocketEngine` to be subclassed

# v13.1.3

- Fix setting reconnectAttempts [#989]((https://github.com/socketio/socket.io-client-swift/issues/989))


# v13.1.2

- Fix [#950](https://github.com/socketio/socket.io-client-swift/issues/950)
- Conforming to `SocketEngineWebsocket` no longer requires conforming to `WebsocketDelegate`


# v13.1.1

- Fix [#923](https://github.com/socketio/socket.io-client-swift/issues/923)
- Fix [#894](https://github.com/socketio/socket.io-client-swift/issues/894)

# v13.1.0

- Allow setting `SocketEngineSpec.extraHeaders` after init.
- Deprecate `SocketEngineSpec.websocket` in favor of just using the `SocketEngineSpec.polling` property.
- Enable bitcode for most platforms.
- Fix [#882](https://github.com/socketio/socket.io-client-swift/issues/882). This adds a new method
`SocketManger.removeSocket(_:)` that should be called if when you no longer wish to use a socket again.
This will cause the engine to no longer keep a strong reference to the socket and no longer track it.

# v13.0.1

- Fix not setting handleQueue on `SocketManager`

# v13.0.0

Checkout out the migration guide in Usage Docs for a more detailed guide on how to migrate to this version.

What's new:
---

- Adds a new `SocketManager` class that multiplexes multiple namespaces through a single engine.
- Adds `.sentPing` and `.gotPong` client events for tracking ping/pongs.
- watchOS support.

Important API changes
---

- Many properties that were previously on `SocketIOClient` have been moved to the `SocketManager`.
- `SocketIOClientOption.nsp` has been removed. Use `SocketManager.socket(forNamespace:)` to create/get a socket attached to a specific namespace.
- Adds `.sentPing` and `.gotPong` client events for tracking ping/pongs.
- Makes the framework a single target.
- Updates Starscream to 3.0
1 change: 1 addition & 0 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "daltoniam/Starscream" ~> 4.0.8
1 change: 1 addition & 0 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "daltoniam/Starscream" "4.0.8"
16 changes: 16 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "Starscream",
"repositoryURL": "https://github.com/daltoniam/Starscream",
"state": {
"branch": null,
"revision": "c6bfd1af48efcc9a9ad203665db12375ba6b145a",
"version": "4.0.8"
}
}
]
},
"version": 1
}
17 changes: 17 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// swift-tools-version:5.4

import PackageDescription

let package = Package(
name: "SocketIO",
products: [
.library(name: "SocketIO", targets: ["SocketIO"])
],
dependencies: [
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMajor(from: "4.0.8")),
],
targets: [
.target(name: "SocketIO", dependencies: ["Starscream"]),
.testTarget(name: "TestSocketIO", dependencies: ["SocketIO"]),
]
)
Loading