@@ -113,6 +113,9 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
113
113
/// If `true`, then the engine is currently in WebSockets mode.
114
114
@available ( * , deprecated, message: " No longer needed, if we're not polling, then we must be doing websockets " )
115
115
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
116
119
117
120
/// The WebSocket for this engine.
118
121
public private( set) var ws : WebSocket ?
@@ -283,7 +286,9 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
283
286
284
287
addHeaders ( to: & req, includingCookies: session? . configuration. httpCookieStorage? . cookies ( for: urlPollingWithSid) )
285
288
286
- ws = WebSocket ( request: req)
289
+ let stream = FoundationStream ( )
290
+ stream. enableSOCKSProxy = enableSOCKSProxy
291
+ ws = WebSocket ( request: req, stream: stream)
287
292
ws? . callbackQueue = engineQueue
288
293
ws? . enableCompression = compress
289
294
ws? . disableSSLCertValidation = selfSigned
@@ -593,6 +598,8 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
593
598
self . security = security
594
599
case . compress:
595
600
self . compress = true
601
+ case . enableSOCKSProxy:
602
+ self . enableSOCKSProxy = true
596
603
default :
597
604
continue
598
605
}
0 commit comments