fix chain traffic data

This commit is contained in:
Nova 2025-04-03 16:14:13 +03:30
parent c10bdc36ff
commit 44d02a6f05
9 changed files with 211 additions and 127 deletions

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.6 // protoc-gen-go v1.36.5
// protoc v6.30.2 // protoc v5.29.3
// source: libcore.proto // source: libcore.proto
package gen package gen
@ -378,12 +378,11 @@ func (x *TestResp) GetResults() []*URLTestResp {
} }
type QueryStatsResp struct { type QueryStatsResp struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Ups map[string]int64 `protobuf:"bytes,1,rep,name=ups,proto3" json:"ups,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` Ups map[string]int64 `protobuf:"bytes,1,rep,name=ups,proto3" json:"ups,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
Downs map[string]int64 `protobuf:"bytes,2,rep,name=downs,proto3" json:"downs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` Downs map[string]int64 `protobuf:"bytes,2,rep,name=downs,proto3" json:"downs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
IntermediateTags []string `protobuf:"bytes,3,rep,name=intermediate_tags,json=intermediateTags,proto3" json:"intermediate_tags,omitempty"` unknownFields protoimpl.UnknownFields
unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache
sizeCache protoimpl.SizeCache
} }
func (x *QueryStatsResp) Reset() { func (x *QueryStatsResp) Reset() {
@ -430,13 +429,6 @@ func (x *QueryStatsResp) GetDowns() map[string]int64 {
return nil return nil
} }
func (x *QueryStatsResp) GetIntermediateTags() []string {
if x != nil {
return x.IntermediateTags
}
return nil
}
type ListConnectionsResp struct { type ListConnectionsResp struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Connections []*ConnectionMetaData `protobuf:"bytes,1,rep,name=connections,proto3" json:"connections,omitempty"` Connections []*ConnectionMetaData `protobuf:"bytes,1,rep,name=connections,proto3" json:"connections,omitempty"`
@ -1043,100 +1035,182 @@ func (x *IsPrivilegedResponse) GetHasPrivilege() bool {
var File_libcore_proto protoreflect.FileDescriptor var File_libcore_proto protoreflect.FileDescriptor
const file_libcore_proto_rawDesc = "" + var file_libcore_proto_rawDesc = string([]byte{
"\n" + 0x0a, 0x0d, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
"\rlibcore.proto\x12\alibcore\"\n" + 0x07, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x0a, 0x0a, 0x08, 0x45, 0x6d, 0x70, 0x74,
"\n" + 0x79, 0x52, 0x65, 0x71, 0x22, 0x0b, 0x0a, 0x09, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73,
"\bEmptyReq\"\v\n" + 0x70, 0x22, 0x21, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14,
"\tEmptyResp\"!\n" + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65,
"\tErrorResp\x12\x14\n" + 0x72, 0x72, 0x6f, 0x72, 0x22, 0x55, 0x0a, 0x0d, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66,
"\x05error\x18\x01 \x01(\tR\x05error\"U\n" + 0x69, 0x67, 0x52, 0x65, 0x71, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x72, 0x65, 0x5f, 0x63, 0x6f,
"\rLoadConfigReq\x12\x1f\n" + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x72, 0x65,
"\vcore_config\x18\x01 \x01(\tR\n" + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c,
"coreConfig\x12#\n" + 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64,
"\rdisable_stats\x18\x02 \x01(\bR\fdisableStats\"e\n" + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0x65, 0x0a, 0x0b, 0x55,
"\vURLTestResp\x12!\n" + 0x52, 0x4c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x75,
"\foutbound_tag\x18\x01 \x01(\tR\voutboundTag\x12\x1d\n" + 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
"\n" + 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x12, 0x1d, 0x0a,
"latency_ms\x18\x02 \x01(\x05R\tlatencyMs\x12\x14\n" + 0x0a, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
"\x05error\x18\x03 \x01(\tR\x05error\"\xd6\x01\n" + 0x05, 0x52, 0x09, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4d, 0x73, 0x12, 0x14, 0x0a, 0x05,
"\aTestReq\x12\x16\n" + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72,
"\x06config\x18\x01 \x01(\tR\x06config\x12#\n" + 0x6f, 0x72, 0x22, 0xd6, 0x01, 0x0a, 0x07, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x16,
"\routbound_tags\x18\x02 \x03(\tR\foutboundTags\x120\n" + 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
"\x14use_default_outbound\x18\x03 \x01(\bR\x12useDefaultOutbound\x12\x10\n" + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75,
"\x03url\x18\x04 \x01(\tR\x03url\x12!\n" + 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6f,
"\ftest_current\x18\x05 \x01(\bR\vtestCurrent\x12'\n" + 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x75,
"\x0fmax_concurrency\x18\x06 \x01(\x05R\x0emaxConcurrency\":\n" + 0x73, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x75, 0x74, 0x62, 0x6f,
"\bTestResp\x12.\n" + 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x75, 0x73, 0x65, 0x44, 0x65,
"\aresults\x18\x01 \x03(\v2\x14.libcore.URLTestRespR\aresults\"\x9d\x02\n" + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x10, 0x0a,
"\x0eQueryStatsResp\x122\n" + 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12,
"\x03ups\x18\x01 \x03(\v2 .libcore.QueryStatsResp.UpsEntryR\x03ups\x128\n" + 0x21, 0x0a, 0x0c, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x18,
"\x05downs\x18\x02 \x03(\v2\".libcore.QueryStatsResp.DownsEntryR\x05downs\x12+\n" + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65,
"\x11intermediate_tags\x18\x03 \x03(\tR\x10intermediateTags\x1a6\n" + 0x6e, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72,
"\bUpsEntry\x12\x10\n" + 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x6d, 0x61, 0x78,
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x22, 0x3a, 0x0a, 0x08, 0x54,
"\x05value\x18\x02 \x01(\x03R\x05value:\x028\x01\x1a8\n" + 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2e, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c,
"\n" + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f,
"DownsEntry\x12\x10\n" + 0x72, 0x65, 0x2e, 0x55, 0x52, 0x4c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x52, 0x07,
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xf0, 0x01, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72,
"\x05value\x18\x02 \x01(\x03R\x05value:\x028\x01\"T\n" + 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x03, 0x75, 0x70,
"\x13ListConnectionsResp\x12=\n" + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72,
"\vconnections\x18\x01 \x03(\v2\x1b.libcore.ConnectionMetaDataR\vconnections\"\x8f\x02\n" + 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70,
"\x12ConnectionMetaData\x12\x0e\n" + 0x2e, 0x55, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x03, 0x75, 0x70, 0x73, 0x12, 0x38,
"\x02id\x18\x01 \x01(\tR\x02id\x12\x1d\n" + 0x0a, 0x05, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e,
"\n" + 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61,
"created_at\x18\x02 \x01(\x03R\tcreatedAt\x12\x16\n" + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72,
"\x06upload\x18\x03 \x01(\x03R\x06upload\x12\x1a\n" + 0x79, 0x52, 0x05, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x1a, 0x36, 0x0a, 0x08, 0x55, 0x70, 0x73, 0x45,
"\bdownload\x18\x04 \x01(\x03R\bdownload\x12\x1a\n" + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
"\boutbound\x18\x05 \x01(\tR\boutbound\x12\x18\n" + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
"\anetwork\x18\x06 \x01(\tR\anetwork\x12\x12\n" + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
"\x04dest\x18\a \x01(\tR\x04dest\x12\x1a\n" + 0x1a, 0x38, 0x0a, 0x0a, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
"\bprotocol\x18\b \x01(\tR\bprotocol\x12\x16\n" + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
"\x06domain\x18\t \x01(\tR\x06domain\x12\x18\n" + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
"\aprocess\x18\n" + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x54, 0x0a, 0x13, 0x4c, 0x69,
" \x01(\tR\aprocess\",\n" + 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73,
"\x14GetGeoIPListResponse\x12\x14\n" + 0x70, 0x12, 0x3d, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73,
"\x05items\x18\x01 \x03(\tR\x05items\".\n" + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65,
"\x16GetGeoSiteListResponse\x12\x14\n" + 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x44,
"\x05items\x18\x02 \x03(\tR\x05items\"$\n" + 0x61, 0x74, 0x61, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73,
"\x0eGeoListRequest\x12\x12\n" + 0x22, 0x8f, 0x02, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d,
"\x04path\x18\x01 \x01(\tR\x04path\"B\n" + 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
"\x18CompileGeoIPToSrsRequest\x12\x12\n" + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74,
"\x04item\x18\x01 \x01(\tR\x04item\x12\x12\n" + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65,
"\x04path\x18\x02 \x01(\tR\x04path\"D\n" + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64,
"\x1aCompileGeoSiteToSrsRequest\x12\x12\n" + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a,
"\x04item\x18\x01 \x01(\tR\x04item\x12\x12\n" + 0x0a, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
"\x04path\x18\x02 \x01(\tR\x04path\"I\n" + 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x75,
"\x15SetSystemProxyRequest\x12\x16\n" + 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x75,
"\x06enable\x18\x01 \x01(\bR\x06enable\x12\x18\n" + 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72,
"\aaddress\x18\x02 \x01(\tR\aaddress\"`\n" + 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b,
"\x13SetSystemDNSRequest\x12\x14\n" + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
"\x05clear\x18\x01 \x01(\bR\x05clear\x12\x18\n" + 0x64, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
"\aservers\x18\x02 \x03(\tR\aservers\x12\x19\n" + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
"\bset_dhcp\x18\x03 \x01(\bR\asetDhcp\"I\n" + 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09,
"\x14GetSystemDNSResponse\x12\x18\n" + 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63,
"\aservers\x18\x01 \x03(\tR\aservers\x12\x17\n" + 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65,
"\ais_dhcp\x18\x02 \x01(\bR\x06isDhcp\";\n" + 0x73, 0x73, 0x22, 0x2c, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, 0x69,
"\x14IsPrivilegedResponse\x12#\n" + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74,
"\rhas_privilege\x18\x01 \x01(\bR\fhasPrivilege2\xf8\a\n" + 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
"\x0eLibcoreService\x12-\n" + 0x22, 0x2e, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69,
"\x04Exit\x12\x11.libcore.EmptyReq\x1a\x12.libcore.EmptyResp\x123\n" + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x74,
"\x05Start\x12\x16.libcore.LoadConfigReq\x1a\x12.libcore.ErrorResp\x12-\n" + 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
"\x04Stop\x12\x11.libcore.EmptyReq\x1a\x12.libcore.ErrorResp\x129\n" + 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
"\vCheckConfig\x12\x16.libcore.LoadConfigReq\x1a\x12.libcore.ErrorResp\x12+\n" + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
"\x04Test\x12\x10.libcore.TestReq\x1a\x11.libcore.TestResp\x121\n" + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x42, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c,
"\bStopTest\x12\x11.libcore.EmptyReq\x1a\x12.libcore.EmptyResp\x128\n" + 0x65, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
"\n" + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
"QueryStats\x12\x11.libcore.EmptyReq\x1a\x17.libcore.QueryStatsResp\x12B\n" + 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02,
"\x0fListConnections\x12\x11.libcore.EmptyReq\x1a\x1c.libcore.ListConnectionsResp\x12F\n" + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x44, 0x0a, 0x1a, 0x43, 0x6f,
"\fGetGeoIPList\x12\x17.libcore.GeoListRequest\x1a\x1d.libcore.GetGeoIPListResponse\x12J\n" + 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72,
"\x0eGetGeoSiteList\x12\x17.libcore.GeoListRequest\x1a\x1f.libcore.GetGeoSiteListResponse\x12J\n" + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d,
"\x11CompileGeoIPToSrs\x12!.libcore.CompileGeoIPToSrsRequest\x1a\x12.libcore.EmptyResp\x12N\n" + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04,
"\x13CompileGeoSiteToSrs\x12#.libcore.CompileGeoSiteToSrsRequest\x1a\x12.libcore.EmptyResp\x12D\n" + 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68,
"\x0eSetSystemProxy\x12\x1e.libcore.SetSystemProxyRequest\x1a\x12.libcore.EmptyResp\x12@\n" + 0x22, 0x49, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f,
"\fGetSystemDNS\x12\x11.libcore.EmptyReq\x1a\x1d.libcore.GetSystemDNSResponse\x12@\n" + 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61,
"\fSetSystemDNS\x12\x1c.libcore.SetSystemDNSRequest\x1a\x12.libcore.EmptyResp\x12@\n" + 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c,
"\fIsPrivileged\x12\x11.libcore.EmptyReq\x1a\x1d.libcore.IsPrivilegedResponseB\x11Z\x0fgrpc_server/genb\x06proto3" 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x60, 0x0a, 0x13, 0x53,
0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x05, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x68, 0x63, 0x70, 0x18, 0x03,
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x65, 0x74, 0x44, 0x68, 0x63, 0x70, 0x22, 0x49, 0x0a,
0x14, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73,
0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12,
0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x64, 0x68, 0x63, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
0x52, 0x06, 0x69, 0x73, 0x44, 0x68, 0x63, 0x70, 0x22, 0x3b, 0x0a, 0x14, 0x49, 0x73, 0x50, 0x72,
0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x23, 0x0a, 0x0d, 0x68, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x68, 0x61, 0x73, 0x50, 0x72, 0x69, 0x76,
0x69, 0x6c, 0x65, 0x67, 0x65, 0x32, 0xf8, 0x07, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x63, 0x6f, 0x72,
0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x45, 0x78, 0x69, 0x74,
0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74,
0x12, 0x16, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f,
0x72, 0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x04,
0x53, 0x74, 0x6f, 0x70, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x0b, 0x43,
0x68, 0x65, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x6c, 0x69, 0x62,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x72, 0x72,
0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2b, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x10,
0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71,
0x1a, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52,
0x65, 0x73, 0x70, 0x12, 0x31, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x70, 0x54, 0x65, 0x73, 0x74, 0x12,
0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52,
0x65, 0x71, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53,
0x74, 0x61, 0x74, 0x73, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45,
0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70,
0x12, 0x42, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x49, 0x50,
0x4c, 0x69, 0x73, 0x74, 0x12, 0x17, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47,
0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x49, 0x50,
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0e,
0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x17,
0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x6f, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72,
0x65, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70,
0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x12, 0x21, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47,
0x65, 0x6f, 0x49, 0x50, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x52, 0x65, 0x73, 0x70, 0x12, 0x4e, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47,
0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x12, 0x23, 0x2e, 0x6c, 0x69,
0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x47, 0x65, 0x6f,
0x53, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x52, 0x65, 0x73, 0x70, 0x12, 0x44, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x1e, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65,
0x2e, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x0c, 0x47, 0x65,
0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x12, 0x11, 0x2e, 0x6c, 0x69, 0x62,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e,
0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x44, 0x4e, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c,
0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x44, 0x4e, 0x53, 0x12, 0x1c, 0x2e, 0x6c,
0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
0x44, 0x4e, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x62,
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40,
0x0a, 0x0c, 0x49, 0x73, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x64, 0x12, 0x11,
0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65,
0x71, 0x1a, 0x1d, 0x2e, 0x6c, 0x69, 0x62, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x73, 0x50, 0x72,
0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x42, 0x11, 0x5a, 0x0f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f,
0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
})
var ( var (
file_libcore_proto_rawDescOnce sync.Once file_libcore_proto_rawDescOnce sync.Once

View File

@ -62,7 +62,6 @@ message TestResp {
message QueryStatsResp{ message QueryStatsResp{
map<string, int64> ups = 1; map<string, int64> ups = 1;
map<string, int64> downs = 2; map<string, int64> downs = 2;
repeated string intermediate_tags = 3;
} }
message ListConnectionsResp { message ListConnectionsResp {

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.5.1
// - protoc v6.30.2 // - protoc v5.29.3
// source: libcore.proto // source: libcore.proto
package gen package gen

View File

@ -190,9 +190,6 @@ func (s *server) QueryStats(ctx context.Context, _ *gen.EmptyReq) (*gen.QuerySta
return nil, E.New("invalid outbound manager type") return nil, E.New("invalid outbound manager type")
} }
for _, out := range outbounds.Outbounds() { for _, out := range outbounds.Outbounds() {
if len(out.Dependencies()) > 0 {
resp.IntermediateTags = append(resp.IntermediateTags, out.Tag())
}
u, d := cApi.TrafficManager().TotalOutbound(out.Tag()) u, d := cApi.TrafficManager().TotalOutbound(out.Tag())
resp.Ups[out.Tag()] = u resp.Ups[out.Tag()] = u
resp.Downs[out.Tag()] = d resp.Downs[out.Tag()] = d

View File

@ -7,6 +7,8 @@ namespace NekoGui_traffic {
public: public:
int id = -1; // ent id int id = -1; // ent id
std::string tag; std::string tag;
bool isChainTail = false;
bool ignoreForRate = false;
long long downlink = 0; long long downlink = 0;
long long uplink = 0; long long uplink = 0;

View File

@ -14,6 +14,7 @@ namespace NekoGui_traffic {
QMutex loop_mutex; QMutex loop_mutex;
QList<std::shared_ptr<TrafficData>> items; QList<std::shared_ptr<TrafficData>> items;
bool isChain;
std::shared_ptr<TrafficData> proxy; std::shared_ptr<TrafficData> proxy;
std::shared_ptr<TrafficData> direct; std::shared_ptr<TrafficData> direct;

View File

@ -265,6 +265,7 @@ namespace NekoGui {
if (ents.length() > 1) { if (ents.length() > 1) {
status->ent->traffic_data->id = status->ent->id; status->ent->traffic_data->id = status->ent->id;
status->ent->traffic_data->tag = chainTagOut.toStdString(); status->ent->traffic_data->tag = chainTagOut.toStdString();
status->ent->traffic_data->ignoreForRate = true;
status->result->outboundStats += status->ent->traffic_data; status->result->outboundStats += status->ent->traffic_data;
} }
@ -275,10 +276,10 @@ namespace NekoGui {
const std::shared_ptr<BuildConfigStatus> &status) { const std::shared_ptr<BuildConfigStatus> &status) {
QString chainTag = "c-" + Int2String(chainId); QString chainTag = "c-" + Int2String(chainId);
QString chainTagOut; QString chainTagOut;
int index = 0;
bool lastWasEndpoint = false; bool lastWasEndpoint = false;
for (const auto &ent: ents) { for (int index = 0; index < ents.length(); index++) {
const auto& ent = ents.at(index);
auto tagOut = chainTag + "-" + Int2String(ent->id) + "-" + Int2String(index); auto tagOut = chainTag + "-" + Int2String(ent->id) + "-" + Int2String(index);
// last profile set as "proxy" // last profile set as "proxy"
@ -290,6 +291,7 @@ namespace NekoGui {
// chain rules: past // chain rules: past
auto replaced = (lastWasEndpoint ? status->endpoints : status->outbounds).last().toObject(); auto replaced = (lastWasEndpoint ? status->endpoints : status->outbounds).last().toObject();
replaced["detour"] = tagOut; replaced["detour"] = tagOut;
ent->traffic_data->isChainTail = true;
(lastWasEndpoint ? status->endpoints : status->outbounds).removeLast(); (lastWasEndpoint ? status->endpoints : status->outbounds).removeLast();
(lastWasEndpoint ? status->endpoints : status->outbounds) += replaced; (lastWasEndpoint ? status->endpoints : status->outbounds) += replaced;
} else { } else {
@ -328,7 +330,6 @@ namespace NekoGui {
status->outbounds += outbound; status->outbounds += outbound;
lastWasEndpoint = false; lastWasEndpoint = false;
} }
index++;
} }
return chainTagOut; return chainTagOut;

View File

@ -21,6 +21,8 @@ namespace NekoGui_traffic {
proxy->uplink_rate = 0; proxy->uplink_rate = 0;
proxy->downlink_rate = 0; proxy->downlink_rate = 0;
int proxyUp = 0, proxyDown = 0;
for (const auto &item: this->items) { for (const auto &item: this->items) {
if (!resp.ups().contains(item->tag)) continue; if (!resp.ups().contains(item->tag)) continue;
auto now = elapsedTimer.elapsed(); auto now = elapsedTimer.elapsed();
@ -29,20 +31,16 @@ namespace NekoGui_traffic {
if (interval <= 0) continue; if (interval <= 0) continue;
auto up = resp.ups().at(item->tag); auto up = resp.ups().at(item->tag);
auto down = resp.downs().at(item->tag); auto down = resp.downs().at(item->tag);
if (item->tag == "proxy")
{
proxyUp = up;
proxyDown = down;
}
item->uplink += up; item->uplink += up;
item->downlink += down; item->downlink += down;
item->uplink_rate = static_cast<double>(up) * 1000.0 / static_cast<double>(interval); item->uplink_rate = static_cast<double>(up) * 1000.0 / static_cast<double>(interval);
item->downlink_rate = static_cast<double>(down) * 1000.0 / static_cast<double>(interval); item->downlink_rate = static_cast<double>(down) * 1000.0 / static_cast<double>(interval);
auto isInter = false; if (item->ignoreForRate) continue;
for (const auto& inter_tag : resp.intermediate_tags())
{
if (inter_tag == item->tag)
{
isInter = true;
break;
}
}
if (isInter) continue;
if (item->tag == "direct") if (item->tag == "direct")
{ {
direct->uplink_rate = item->uplink_rate; direct->uplink_rate = item->uplink_rate;
@ -53,6 +51,17 @@ namespace NekoGui_traffic {
proxy->downlink_rate += item->downlink_rate; proxy->downlink_rate += item->downlink_rate;
} }
} }
if (isChain)
{
for (const auto &item: this->items)
{
if (item->isChainTail)
{
item->uplink += proxyUp;
item->downlink += proxyDown;
}
}
}
} }
void TrafficLooper::Loop() { void TrafficLooper::Loop() {

View File

@ -286,6 +286,7 @@ void MainWindow::neko_start(int _id) {
NekoGui_traffic::trafficLooper->proxy = std::make_shared<NekoGui_traffic::TrafficData>("proxy"); NekoGui_traffic::trafficLooper->proxy = std::make_shared<NekoGui_traffic::TrafficData>("proxy");
NekoGui_traffic::trafficLooper->direct = std::make_shared<NekoGui_traffic::TrafficData>("direct"); NekoGui_traffic::trafficLooper->direct = std::make_shared<NekoGui_traffic::TrafficData>("direct");
NekoGui_traffic::trafficLooper->items = result->outboundStats; NekoGui_traffic::trafficLooper->items = result->outboundStats;
NekoGui_traffic::trafficLooper->isChain = ent->type == "chain";
NekoGui_traffic::trafficLooper->loop_enabled = true; NekoGui_traffic::trafficLooper->loop_enabled = true;
NekoGui_traffic::connection_lister->suspend = false; NekoGui_traffic::connection_lister->suspend = false;