switch core support

add nekobox_core

linux: use sing-box for vpn
This commit is contained in:
arm64v8a
2022-09-24 22:42:22 +08:00
parent a083010795
commit 9ebf6fe807
87 changed files with 3496 additions and 1903 deletions

View File

@@ -34,7 +34,7 @@ namespace NekoRay::traffic {
QJsonArray TrafficLooper::get_connection_list() {
#ifndef NKR_NO_GRPC
auto str = NekoRay::rpc::defaultClient->ListV2rayConnections();
auto str = NekoRay::rpc::defaultClient->ListConnections();
QJsonDocument jsonDocument = QJsonDocument::fromJson(str.c_str());
return jsonDocument.array();
#else
@@ -61,7 +61,8 @@ namespace NekoRay::traffic {
update_stats(bypass);
}
[[noreturn]] void TrafficLooper::loop() {
void TrafficLooper::loop() {
if (IS_NEKO_BOX) return; // TODO upstream api
while (true) {
auto sleep_ms = dataStore->traffic_loop_interval;
auto user_disabled = sleep_ms == 0;