Skip to content

Commit bfd538f

Browse files
authored
iOS 26 Simulator crash workaround (#738)
1 parent 971f5d2 commit bfd538f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Sources/LiveKit/Support/WebSocket.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import Foundation
18+
import Network
1819

1920
typealias WebSocketStream = AsyncThrowingStream<URLSessionWebSocketTask.Message, Error>
2021

@@ -32,6 +33,11 @@ final class WebSocket: NSObject, @unchecked Sendable, Loggable, AsyncSequence, U
3233
private let request: URLRequest
3334

3435
private lazy var urlSession: URLSession = {
36+
#if targetEnvironment(simulator)
37+
if #available(iOS 26.0, *) {
38+
nw_tls_create_options()
39+
}
40+
#endif
3541
let config = URLSessionConfiguration.default
3642
// explicitly set timeout intervals
3743
config.timeoutIntervalForRequest = TimeInterval(60)

0 commit comments

Comments
 (0)