File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,25 @@ import XCTest
22
22
final class WebSocketClientTests : XCTestCase {
23
23
24
24
func testEchoServer( ) async throws {
25
+ let clientLogger = {
26
+ var logger = Logger ( label: " client " )
27
+ logger. logLevel = . trace
28
+ return logger
29
+ } ( )
30
+ try await WebSocketClient . connect (
31
+ url: " wss://echo.websocket.org/ " ,
32
+ tlsConfiguration: TLSConfiguration . makeClientConfiguration ( ) ,
33
+ logger: clientLogger
34
+ ) { inbound, outbound, _ in
35
+ var inboundIterator = inbound. messages ( maxSize: . max) . makeAsyncIterator ( )
36
+ try await outbound. write ( . text( " hello " ) )
37
+ if let msg = try await inboundIterator. next ( ) {
38
+ print ( msg)
39
+ }
40
+ }
41
+ }
42
+
43
+ func testEchoServerWithSNIHostname( ) async throws {
25
44
let clientLogger = {
26
45
var logger = Logger ( label: " client " )
27
46
logger. logLevel = . trace
You can’t perform that action at this time.
0 commit comments