Skip to content

Commit

Permalink
Split WS client from server (#87)
Browse files Browse the repository at this point in the history
* Stage 1 - split into separate libraries internal to package

* Make WebSocketType internal

* swift format

* Use swift-websocket

* typo

* Remove all client code/tests

* Don't output docs for HummingbirdWS client/compression targets

* Update docs

* Temporarily use utf8-validation branch

* Add validateUTF8

* Use swift-websocket 0.1.0

* Remove InvalidUTF8Frame tests from 5.10

* Remove HummingbirdWSCore files

* Use swift-websocket 1.0

* Use Hummingbird 2.5

* Don't log inputClosed on upgrade as an error
  • Loading branch information
adam-fowler authored Nov 21, 2024
1 parent 54f08f5 commit a382c7d
Show file tree
Hide file tree
Showing 40 changed files with 58 additions and 3,632 deletions.
30 changes: 5 additions & 25 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,23 @@ let package = Package(
.library(name: "HummingbirdWSTesting", targets: ["HummingbirdWSTesting"]),
],
dependencies: [
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.0.0"),
.package(url: "https://github.com/apple/swift-http-types.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.0"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.62.0"),
.package(url: "https://github.com/hummingbird-project/hummingbird.git", from: "2.5.0"),
.package(url: "https://github.com/hummingbird-project/swift-websocket.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.22.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.5.0"),
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.20.0"),
.package(url: "https://github.com/adam-fowler/compress-nio.git", from: "1.3.0"),
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.0.0"),
],
targets: [
.target(name: "HummingbirdWebSocket", dependencies: [
.byName(name: "HummingbirdWSCore"),
.product(name: "WSCore", package: "swift-websocket"),
.product(name: "Hummingbird", package: "hummingbird"),
.product(name: "NIOHTTPTypes", package: "swift-nio-extras"),
.product(name: "NIOHTTPTypesHTTP1", package: "swift-nio-extras"),
], swiftSettings: swiftSettings),
.target(name: "HummingbirdWSClient", dependencies: [
.byName(name: "HummingbirdWSCore"),
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "Logging", package: "swift-log"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOHTTPTypesHTTP1", package: "swift-nio-extras"),
.product(name: "NIOPosix", package: "swift-nio"),
.product(name: "NIOSSL", package: "swift-nio-ssl"),
.product(name: "NIOTransportServices", package: "swift-nio-transport-services"),
.product(name: "NIOWebSocket", package: "swift-nio"),
.product(name: "WSClient", package: "swift-websocket"),
], swiftSettings: swiftSettings),
.target(name: "HummingbirdWSCore", dependencies: [
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOWebSocket", package: "swift-nio"),
.product(name: "ServiceLifecycle", package: "swift-service-lifecycle"),
]),
.target(name: "HummingbirdWSCompression", dependencies: [
.byName(name: "HummingbirdWSCore"),
.product(name: "CompressNIO", package: "compress-nio"),
.product(name: "WSCompression", package: "swift-websocket"),
], swiftSettings: swiftSettings),
.target(name: "HummingbirdWSTesting", dependencies: [
.byName(name: "HummingbirdWSClient"),
Expand Down
50 changes: 0 additions & 50 deletions Snippets/AutobahnClientTest.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Snippets/AutobahnServerTest.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Hummingbird
import HummingbirdWebSocket
import HummingbirdWSCompression
import Logging
import WSCompression

// Autobahn tests (https://github.com/crossbario/autobahn-testsuite)
// run
Expand Down
19 changes: 0 additions & 19 deletions Snippets/WebSocketClientTest.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Snippets/WebsocketTest.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import HTTPTypes
import Hummingbird
import HummingbirdWebSocket
import HummingbirdWSCompression
import Logging
import NIOWebSocket
import WSCompression

var logger = Logger(label: "Echo")
logger.logLevel = .trace
Expand Down
36 changes: 0 additions & 36 deletions Sources/HummingbirdWSClient/Client/ClientChannel.swift

This file was deleted.

176 changes: 0 additions & 176 deletions Sources/HummingbirdWSClient/Client/ClientConnection.swift

This file was deleted.

Loading

0 comments on commit a382c7d

Please sign in to comment.