async init not required
This commit is contained in:
@@ -29,7 +29,7 @@ Future<void> onStart(ServiceInstance service) async {
|
|||||||
Timer? timeout;
|
Timer? timeout;
|
||||||
final startedProxyType = <ProxyType>{};
|
final startedProxyType = <ProxyType>{};
|
||||||
|
|
||||||
await Tor.init();
|
Tor.init();
|
||||||
|
|
||||||
final portSub = Tor.instance.events.stream.listen((port) {
|
final portSub = Tor.instance.events.stream.listen((port) {
|
||||||
service.invoke('portUpdate', {'port': port});
|
service.invoke('portUpdate', {'port': port});
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class _MyAppState extends State<Home> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Future<void> startTor() async {
|
Future<void> startTor() async {
|
||||||
await Tor.init();
|
Tor.init();
|
||||||
|
|
||||||
// Start the proxy
|
// Start the proxy
|
||||||
await Tor.instance.start();
|
await Tor.instance.start();
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ class Tor {
|
|||||||
/// Returns a Future that completes when the Tor service has started.
|
/// Returns a Future that completes when the Tor service has started.
|
||||||
///
|
///
|
||||||
/// Throws an exception if the Tor service fails to start.
|
/// Throws an exception if the Tor service fails to start.
|
||||||
static Future<Tor> init({bool enabled = true}) async {
|
static Tor init({bool enabled = true}) {
|
||||||
final singleton = Tor._instance;
|
final singleton = Tor._instance;
|
||||||
singleton._enabled = enabled;
|
singleton._enabled = enabled;
|
||||||
return singleton;
|
return singleton;
|
||||||
|
|||||||
Reference in New Issue
Block a user