From dc87d774d3a2437f3ecf13341e01612499199c00 Mon Sep 17 00:00:00 2001 From: fosse Date: Mon, 8 Jan 2024 18:18:13 -0500 Subject: [PATCH] save --- lib/utils/proxy_wrapper.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/utils/proxy_wrapper.dart b/lib/utils/proxy_wrapper.dart index ea125a8f4..7c85e05c1 100644 --- a/lib/utils/proxy_wrapper.dart +++ b/lib/utils/proxy_wrapper.dart @@ -6,18 +6,22 @@ import 'package:socks5_proxy/socks.dart'; import 'package:tor/tor.dart'; class ProxyWrapper { - // Private constructor - ProxyWrapper._privateConstructor(this.settingsStore); + + ProxyWrapper({ + required this.settingsStore, + }); + + // ProxyWrapper._privateConstructor(); // Static private instance of Tor - static final ProxyWrapper _instance = ProxyWrapper._privateConstructor(); + // static final ProxyWrapper _instance = ProxyWrapper._privateConstructor(); - final SettingsStore settingsStore; + late SettingsStore settingsStore; HttpClient? _torClient; // Factory method to get the singleton instance of TorSingleton - static ProxyWrapper get instance => _instance; + // static ProxyWrapper get instance => _instance; static int get port => Tor.instance.port; @@ -27,7 +31,7 @@ class ProxyWrapper { bool torEnabled = false; bool torOnly = false; - // Method to get or create the Tor instance + // Method to get or create the Tor proxy instance Future getProxyInstance({int? portOverride}) async { if (!started) { started = true;