File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ struct WebSocketClientChannel: ClientConnectionChannel {
6363 let requiresTLS = self . url. scheme == . wss || self . url. scheme == . https
6464 let port = self . url. port ?? ( requiresTLS ? 443 : 80 )
6565
66- switch proxy. type
66+ switch proxy. type. value
6767 {
6868 case . http( let connectHeaders) :
6969 return setupHTTPProxy (
Original file line number Diff line number Diff line change @@ -64,11 +64,17 @@ public struct WebSocketClientConfiguration: Sendable {
6464/// WebSocket client proxy settings
6565public struct WebSocketProxySettings : Sendable {
6666 /// Type of proxy
67- public enum ProxyType : Sendable {
67+ public struct ProxyType : Sendable {
68+ enum Base {
69+ case socks
70+ case http( connectHeaders: HTTPFields = [ : ] )
71+ }
72+ let value : Base
73+
6874 /// SOCKS proxy
69- case socks
75+ public static var socks : ProxyType { . init ( value : . socks ) }
7076 /// HTTP proxy
71- case http( connectHeaders: HTTPFields = [ : ] )
77+ public static func http( connectHeaders: HTTPFields = [ : ] ) -> ProxyType { . init ( value : . http ( connectHeaders : connectHeaders ) ) }
7278 }
7379 /// Proxy endpoint hostname
7480 public var host : String
You can’t perform that action at this time.
0 commit comments