From cf7a38ec8c4d582e46251f7b123e6d98ee88698b Mon Sep 17 00:00:00 2001 From: saint Date: Sat, 8 Jun 2024 12:39:20 -0400 Subject: [PATCH] Updated README websocket client example --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3760d0b..7262204 100644 --- a/README.md +++ b/README.md @@ -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"