added support for tor entry/exit countries

This commit is contained in:
Fabian Freund
2026-01-08 18:42:03 +01:00
parent f23c1fa04f
commit 2741876ed5
9 changed files with 276 additions and 35 deletions
@@ -136,6 +136,8 @@ class TorProxyService extends _$TorProxyService {
null => TransportType.none,
},
bridgeLines: setting?.bridge.bridges ?? [],
entryNodeCountries: torSettings.entryNodeCountry?.toLowerCase(),
exitNodeCountries: torSettings.exitNodeCountry?.toLowerCase(),
);
await _tor.start(config);
@@ -155,6 +157,10 @@ class TorProxyService extends _$TorProxyService {
await _tor.stop();
}
Future<void> requestNewIdentity() async {
await _tor.requestNewIdentity();
}
@override
Stream<TorStatus> build() {
_statusSyncController = StreamController();
@@ -33,7 +33,7 @@ final class TorProxyServiceProvider
TorProxyService create() => TorProxyService();
}
String _$torProxyServiceHash() => r'be69327bdef8feaa2a43bd83f20168988dcdd228';
String _$torProxyServiceHash() => r'0bf00b61bf7e739fe8c77696cf1b2a151d137671';
abstract class _$TorProxyService extends $StreamNotifier<TorStatus> {
Stream<TorStatus> build();