new: add custom url-test for each repository

This commit is contained in:
hiddify-com
2024-07-29 13:11:51 +02:00
parent ccbc416c49
commit b9afe586bf
14 changed files with 417 additions and 157 deletions

View File

@@ -17,15 +17,11 @@ class PlatformSingboxService with InfraLogger implements SingboxService {
static const channelPrefix = "com.hiddify.app";
static const methodChannel = MethodChannel("$channelPrefix/method");
static const statusChannel =
EventChannel("$channelPrefix/service.status", JSONMethodCodec());
static const alertsChannel =
EventChannel("$channelPrefix/service.alerts", JSONMethodCodec());
static const statsChannel =
EventChannel("$channelPrefix/stats", JSONMethodCodec());
static const statusChannel = EventChannel("$channelPrefix/service.status", JSONMethodCodec());
static const alertsChannel = EventChannel("$channelPrefix/service.alerts", JSONMethodCodec());
static const statsChannel = EventChannel("$channelPrefix/stats", JSONMethodCodec());
static const groupsChannel = EventChannel("$channelPrefix/groups");
static const activeGroupsChannel =
EventChannel("$channelPrefix/active-groups");
static const activeGroupsChannel = EventChannel("$channelPrefix/active-groups");
static const logsChannel = EventChannel("$channelPrefix/service.logs");
late final ValueStream<SingboxStatus> _status;
@@ -33,10 +29,8 @@ class PlatformSingboxService with InfraLogger implements SingboxService {
@override
Future<void> init() async {
loggy.debug("initializing");
final status =
statusChannel.receiveBroadcastStream().map(SingboxStatus.fromEvent);
final alerts =
alertsChannel.receiveBroadcastStream().map(SingboxStatus.fromEvent);
final status = statusChannel.receiveBroadcastStream().map(SingboxStatus.fromEvent);
final alerts = alertsChannel.receiveBroadcastStream().map(SingboxStatus.fromEvent);
_status = ValueConnectableStream(Rx.merge([status, alerts])).autoConnect();
await _status.first;
@@ -250,9 +244,7 @@ class PlatformSingboxService with InfraLogger implements SingboxService {
@override
Stream<List<String>> watchLogs(String path) async* {
yield* logsChannel
.receiveBroadcastStream()
.map((event) => (event as List).map((e) => e as String).toList());
yield* logsChannel.receiveBroadcastStream().map((event) => (event as List).map((e) => e as String).toList());
}
@override