WebSocketClient
March 23, 2017 ยท View on GitHub
Installation
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/Zewo/WebSocketClient.git", majorVersion: 0, minor: 14),
]
)
Example
import WebSocketClient
let name = "Dan"
let client = try WebSocketClient(url: "ws://localhost:8080") { ws in
print("Connected!")
ws.onText { text in
print("received text: \(text)")
try ws.send(text)
}
ws.onClose { code, reason in
print("\(code): \(reason)")
}
try ws.send("Hi, I'm \(name)!")
}
try client.connect()
Support
If you need any help you can join our Slack and go to the #help channel. Or you can create a Github issue in our main repository. When stating your issue be sure to add enough details, specify what module is causing the problem and reproduction steps.
Community
The entire Zewo code base is licensed under MIT. By contributing to Zewo you are contributing to an open and engaged community of brilliant Swift programmers. Join us on Slack to get to know us!
License
This project is released under the MIT license. See LICENSE for details.
