2
2
//
3
3
// This source file is part of the Hummingbird server framework project
4
4
//
5
- // Copyright (c) 2023-2024 the Hummingbird authors
5
+ // Copyright (c) 2023-2025 the Hummingbird authors
6
6
// Licensed under Apache License v2.0
7
7
//
8
8
// See LICENSE.txt for license information
@@ -29,6 +29,8 @@ public struct WebSocketClientConfiguration: Sendable {
29
29
public var autoPing : AutoPingSetup
30
30
/// Should text be validated to be UTF8
31
31
public var validateUTF8 : Bool
32
+ /// Hostname used during TLS handshake
33
+ public var sniHostname : String ?
32
34
33
35
/// Initialize WebSocketClient configuration
34
36
/// - Paramters
@@ -37,19 +39,23 @@ public struct WebSocketClientConfiguration: Sendable {
37
39
/// - extensions: WebSocket extensions
38
40
/// - autoPing: Automatic Ping configuration
39
41
/// - validateUTF8: Should text be checked to see if it is valid UTF8
42
+ /// - sniHostname: Hostname used during TLS handshake
43
+ @_disfavoredOverload
40
44
public init (
41
45
maxFrameSize: Int = ( 1 << 14 ) ,
42
46
additionalHeaders: HTTPFields = . init( ) ,
43
47
extensions: [ WebSocketExtensionFactory ] = [ ] ,
44
48
closeTimeout: Duration = . seconds( 15 ) ,
45
49
autoPing: AutoPingSetup = . disabled,
46
- validateUTF8: Bool = false
50
+ validateUTF8: Bool = false ,
51
+ sniHostname: String ? = nil
47
52
) {
48
53
self . maxFrameSize = maxFrameSize
49
54
self . additionalHeaders = additionalHeaders
50
55
self . extensions = extensions. map { $0. build ( ) }
51
56
self . closeTimeout = closeTimeout
52
57
self . autoPing = autoPing
53
58
self . validateUTF8 = validateUTF8
59
+ self . sniHostname = nil
54
60
}
55
61
}
0 commit comments