@@ -113,6 +113,9 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
113113 /// If `true`, then the engine is currently in WebSockets mode.
114114 @available ( * , deprecated, message: " No longer needed, if we're not polling, then we must be doing websockets " )
115115 public private( set) var websocket = false
116+
117+ /// When `true`, the WebSocket `stream` will be configured with the enableSOCKSProxy `true`.
118+ public private( set) var enableSOCKSProxy = false
116119
117120 /// The WebSocket for this engine.
118121 public private( set) var ws : WebSocket ?
@@ -283,7 +286,9 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
283286
284287 addHeaders ( to: & req, includingCookies: session? . configuration. httpCookieStorage? . cookies ( for: urlPollingWithSid) )
285288
286- ws = WebSocket ( request: req)
289+ let stream = FoundationStream ( )
290+ stream. enableSOCKSProxy = enableSOCKSProxy
291+ ws = WebSocket ( request: req, stream: stream)
287292 ws? . callbackQueue = engineQueue
288293 ws? . enableCompression = compress
289294 ws? . disableSSLCertValidation = selfSigned
@@ -593,6 +598,8 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
593598 self . security = security
594599 case . compress:
595600 self . compress = true
601+ case . enableSOCKSProxy:
602+ self . enableSOCKSProxy = true
596603 default :
597604 continue
598605 }
0 commit comments