update core

This commit is contained in:
arm64v8a
2023-04-05 12:55:49 +09:00
parent 848385b729
commit f1d5fcd2f8
4 changed files with 10 additions and 18 deletions

View File

@@ -4,7 +4,7 @@ go 1.19
require ( require (
github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1 github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1
github.com/matsuridayo/sing-box-extra v0.0.0-20230403023034-c868033055eb github.com/matsuridayo/sing-box-extra v0.0.0-20230404135215-f6737f68d71c
github.com/sagernet/sing-box v1.2.3-0.20230402040603-f8be48401998 github.com/sagernet/sing-box v1.2.3-0.20230402040603-f8be48401998
grpc_server v1.0.0 grpc_server v1.0.0
) )
@@ -92,3 +92,7 @@ require (
replace grpc_server v1.0.0 => ../../grpc_server replace grpc_server v1.0.0 => ../../grpc_server
// replace github.com/matsuridayo/sing-box-extra => ../../../../sing-box-extra // replace github.com/matsuridayo/sing-box-extra => ../../../../sing-box-extra
// replace github.com/sagernet/sing-box => ../../../../sing-box
// replace github.com/sagernet/sing-dns => ../../../../sing-dns

View File

@@ -95,8 +95,8 @@ github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczG
github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1 h1:+FflyEuq2hn++MENFuT1/qFHz0KITKK/F6ZHxs23mrg= github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1 h1:+FflyEuq2hn++MENFuT1/qFHz0KITKK/F6ZHxs23mrg=
github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1/go.mod h1:IRO07Queptz/rGFvEW+3Hmwpx7MCup6WiDs4p5jMt4g= github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1/go.mod h1:IRO07Queptz/rGFvEW+3Hmwpx7MCup6WiDs4p5jMt4g=
github.com/matsuridayo/sing-box-extra v0.0.0-20230403023034-c868033055eb h1:+H4kzku3mIffN7fazOjr3gRV5oTZwE/K7cghWHTGU6Q= github.com/matsuridayo/sing-box-extra v0.0.0-20230404135215-f6737f68d71c h1:dLXFFqBQXNCXAkLH9KURnSe4rwkCe3h/5BXsmwGKmXI=
github.com/matsuridayo/sing-box-extra v0.0.0-20230403023034-c868033055eb/go.mod h1:MJNdOWGkzlQilH83i2lG5aSZx1IA8Y6Ywnn8Je9y5lY= github.com/matsuridayo/sing-box-extra v0.0.0-20230404135215-f6737f68d71c/go.mod h1:MJNdOWGkzlQilH83i2lG5aSZx1IA8Y6Ywnn8Je9y5lY=
github.com/mholt/acmez v1.1.0 h1:IQ9CGHKOHokorxnffsqDvmmE30mDenO1lptYZ1AYkHY= github.com/mholt/acmez v1.1.0 h1:IQ9CGHKOHokorxnffsqDvmmE30mDenO1lptYZ1AYkHY=
github.com/mholt/acmez v1.1.0/go.mod h1:zwo5+fbLLTowAX8o8ETfQzbDtwGEXnPhkmGdKIP+bgs= github.com/mholt/acmez v1.1.0/go.mod h1:zwo5+fbLLTowAX8o8ETfQzbDtwGEXnPhkmGdKIP+bgs=
github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw= github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw=

View File

@@ -21,7 +21,6 @@ import (
"time" "time"
"unsafe" "unsafe"
"github.com/sagernet/sing-box/experimental/v2rayapi"
"github.com/sagernet/sing-box/option" "github.com/sagernet/sing-box/option"
) )
@@ -147,20 +146,9 @@ func (s *server) Test(ctx context.Context, in *gen.TestReq) (out *gen.TestResp,
func (s *server) QueryStats(ctx context.Context, in *gen.QueryStatsReq) (out *gen.QueryStatsResp, _ error) { func (s *server) QueryStats(ctx context.Context, in *gen.QueryStatsReq) (out *gen.QueryStatsResp, _ error) {
out = &gen.QueryStatsResp{} out = &gen.QueryStatsResp{}
var box_v2ray_service *boxapi.SbV2rayStatsService
if instance != nil && instance.Router().V2RayServer() != nil { if instance != nil && instance.Router().V2RayServer() != nil {
box_v2ray_service, _ = instance.Router().V2RayServer().StatsService().(*boxapi.SbV2rayStatsService) if ss, ok := instance.Router().V2RayServer().(*boxapi.SbV2rayServer); ok {
} out.Traffic = ss.QueryStats(fmt.Sprintf("outbound>>>%s>>>traffic>>>%s", in.Tag, in.Direct))
if box_v2ray_service != nil {
req := &v2rayapi.GetStatsRequest{
Name: fmt.Sprintf("outbound>>>%s>>>traffic>>>%s", in.Tag, in.Direct),
Reset_: true,
}
resp, err := box_v2ray_service.GetStats(ctx, req)
if err == nil {
out.Traffic = resp.Stat.Value
} }
} }

View File

@@ -32,5 +32,5 @@ popd
#### Go: nekobox_core #### #### Go: nekobox_core ####
pushd go/cmd/nekobox_core pushd go/cmd/nekobox_core
go build -v -o $DEST -trimpath -ldflags "-w -s -X $neko_common.Version_neko=$version_standalone" -tags "with_grpc,with_gvisor,with_quic,with_wireguard,with_utls,with_v2ray_api" go build -v -o $DEST -trimpath -ldflags "-w -s -X $neko_common.Version_neko=$version_standalone" -tags "with_grpc,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api"
popd popd