     }
 
     func connect(delegateQueue: OperationQueue?) {
+        
+        let configuration = URLSessionConfiguration.default
+        configuration.connectionProxyDictionary = [
+            kCFNetworkProxiesHTTPEnable: 1,
+            kCFNetworkProxiesHTTPProxy: "squid.example.com",
+            kCFNetworkProxiesHTTPPort: 3128,
+            
+            // 以下がないと https の通信にはプロキシーが利用されなかった
+            // 以下の問題がある
+            // - kCFNetworkProxiesHTTPS ... から始まるキーが iOS では利用できない
+            // -  kCFStreamPropertyHTTPS ... から始まるキーは deprecated になっている
+            kCFStreamPropertyHTTPSProxyHost: "squid.example.com",
+            kCFStreamPropertyHTTPSProxyPort: 3128,
+        ]
+        
         Logger.debug(type: .webSocketChannel, message: "[\(host)] connecting")
-        urlSession = URLSession(configuration: .default,
+        urlSession = URLSession(configuration: configuration,
                                 delegate: self,
                                 delegateQueue: delegateQueue)
+        
+        Logger.info(type: .webSocketChannel, message: "proxy: \(String(describing: urlSession?.configuration.connectionProxyDictionary.debugDescription))")
+        
         webSocketTask = urlSession?.webSocketTask(with: url)
+        
         webSocketTask?.resume()
         receive()
     }

            disconnect(error: error)
        }
    }
}

        guard !isClosing else {
            return
        }
        Logger.debug(type: .webSocketChannel, message: "[\(host)] \(#function)")
        if let onConnect = internalHandlers.onConnect {
            onConnect(self)
