Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ public class AwesomeWebSocketHandler: WebSocketMessageHandler {
Now that we have a secure WebSocket server, we can use a secure WebSocket client as well by passing the CA certificate. Note that you only have to specify the CA certificate if the certificate isn't a root CA trusted by Apple or if you want to benefit from [certificate pinning](https://security.stackexchange.com/questions/29988/what-is-certificate-pinning).

```swift
client = try! WebSocketClient("wss://localhost:9000", certificates: [caCertificate])
let client = try! WebSocketClient("wss://localhost:9000", certificates: [caCertificate])
client.delegate = self
client.connect()

// You can specify headers too
client.headers.authorization = "Bearer secret-token"
Expand Down