mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
update box
This commit is contained in:
@@ -8,16 +8,16 @@ import (
|
||||
"github.com/matsuridayo/libneko/neko_log"
|
||||
"github.com/matsuridayo/sing-box-extra/boxapi"
|
||||
"github.com/matsuridayo/sing-box-extra/boxbox"
|
||||
"github.com/matsuridayo/sing-box-extra/boxmain"
|
||||
)
|
||||
|
||||
var instance *boxbox.Box
|
||||
var instance_cancel context.CancelFunc
|
||||
|
||||
// Use sing-box instead of libcore & v2ray
|
||||
|
||||
func setupCore() {
|
||||
neko_log.SetupLog(50*1024, "./neko.log")
|
||||
boxmain.DisableColor()
|
||||
//
|
||||
neko_log.SetupLog(50*1024, "./neko.log")
|
||||
neko_common.GetProxyHttpClient = func() *http.Client {
|
||||
return boxapi.GetProxyHttpClient(instance)
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@ go 1.19
|
||||
|
||||
require (
|
||||
github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1
|
||||
github.com/matsuridayo/sing-box-extra v0.0.0-20230317120926-b8909ef152cc
|
||||
github.com/sagernet/sing-box v1.1.6-0.20230317050722-ce6d18634525
|
||||
github.com/matsuridayo/sing-box-extra v0.0.0-20230320103851-5151ef0514be
|
||||
github.com/sagernet/sing-box v1.1.6-0.20230320093659-f680d0acaf15
|
||||
grpc_server v1.0.0
|
||||
)
|
||||
|
||||
require (
|
||||
berty.tech/go-libtor v1.0.385 // indirect
|
||||
github.com/Dreamacro/clash v1.13.0 // indirect
|
||||
github.com/Dreamacro/clash v1.14.0 // indirect
|
||||
github.com/ajg/form v1.5.1 // indirect
|
||||
github.com/andybalholm/brotli v1.0.5 // indirect
|
||||
github.com/caddyserver/certmagic v0.17.2 // indirect
|
||||
@@ -53,9 +53,9 @@ require (
|
||||
github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 // indirect
|
||||
github.com/sagernet/quic-go v0.0.0-20230202071646-a8c8afb18b32 // indirect
|
||||
github.com/sagernet/reality v0.0.0-20230312150606-35ea9af0e0b8 // indirect
|
||||
github.com/sagernet/sing v0.1.9-0.20230317044231-85a9429eadb6 // indirect
|
||||
github.com/sagernet/sing v0.2.1-0.20230318094614-4bbf5f2c3046 // indirect
|
||||
github.com/sagernet/sing-dns v0.1.4 // indirect
|
||||
github.com/sagernet/sing-shadowsocks v0.1.2-0.20230221080503-769c01d6bba9 // indirect
|
||||
github.com/sagernet/sing-shadowsocks v0.2.0 // indirect
|
||||
github.com/sagernet/sing-shadowtls v0.1.0 // indirect
|
||||
github.com/sagernet/sing-tun v0.1.3-0.20230315134716-fe89bbded22d // indirect
|
||||
github.com/sagernet/sing-vmess v0.1.3 // indirect
|
||||
@@ -81,6 +81,7 @@ require (
|
||||
golang.org/x/text v0.8.0 // indirect
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
|
||||
golang.org/x/tools v0.6.0 // indirect
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230215201556-9c5414ab4bde // indirect
|
||||
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
|
||||
google.golang.org/grpc v1.53.0 // indirect
|
||||
google.golang.org/protobuf v1.30.0 // indirect
|
||||
@@ -90,4 +91,4 @@ require (
|
||||
|
||||
replace grpc_server v1.0.0 => ../../grpc_server
|
||||
|
||||
// replace github.com/sagernet/sing-box => ../../../../sing-box
|
||||
// replace github.com/matsuridayo/sing-box-extra => ../../../../sing-box-extra
|
||||
|
||||
@@ -5,8 +5,8 @@ cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y=
|
||||
cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE=
|
||||
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Dreamacro/clash v1.13.0 h1:gF0E0TluE1LCmuhhg0/bjqABYDmSnXkUjXjRhZxyrm8=
|
||||
github.com/Dreamacro/clash v1.13.0/go.mod h1:hf0RkWPsQ0e8oS8WVJBIRocY/1ILYzQQg9zeMwd8LsM=
|
||||
github.com/Dreamacro/clash v1.14.0 h1:ehJ/C/1m9LEjmME72WSE/Y2YqbR3Q54AbjqiRCvtyW4=
|
||||
github.com/Dreamacro/clash v1.14.0/go.mod h1:ia2CU7V713H1QdCqMwOLK9U9V5Ay8X0voj3yQr2tk+I=
|
||||
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
|
||||
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
|
||||
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
||||
@@ -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/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/sing-box-extra v0.0.0-20230317120926-b8909ef152cc h1:2iSGS2q0iPP2zS+vdHwQ0QUJbDdMQzSn6BrRcdJW/FY=
|
||||
github.com/matsuridayo/sing-box-extra v0.0.0-20230317120926-b8909ef152cc/go.mod h1:qta/MDyqgrB26dNt5ntONpeSqpWwx/aBbdmLs7bcgLQ=
|
||||
github.com/matsuridayo/sing-box-extra v0.0.0-20230320103851-5151ef0514be h1:6nHjGjsj0QXrHm4CXJ6Jt1wS8VWCSC+Wv7D1ZQ826dI=
|
||||
github.com/matsuridayo/sing-box-extra v0.0.0-20230320103851-5151ef0514be/go.mod h1:LRC87IXsjhPzMOLz2niOLPqa2yDZ/WoKhuenXloXvdI=
|
||||
github.com/mholt/acmez v1.1.0 h1:IQ9CGHKOHokorxnffsqDvmmE30mDenO1lptYZ1AYkHY=
|
||||
github.com/mholt/acmez v1.1.0/go.mod h1:zwo5+fbLLTowAX8o8ETfQzbDtwGEXnPhkmGdKIP+bgs=
|
||||
github.com/miekg/dns v1.1.52 h1:Bmlc/qsNNULOe6bpXcUTsuOajd0DzRHwup6D9k1An0c=
|
||||
@@ -139,14 +139,14 @@ github.com/sagernet/reality v0.0.0-20230312150606-35ea9af0e0b8 h1:4M3+0/kqvJuTsi
|
||||
github.com/sagernet/reality v0.0.0-20230312150606-35ea9af0e0b8/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
|
||||
github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
|
||||
github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk=
|
||||
github.com/sagernet/sing v0.1.9-0.20230317044231-85a9429eadb6 h1:h1wGLPBJLjujj9kYSbLiP1Tt6+IQnZ7Ok7jQd4u3xxk=
|
||||
github.com/sagernet/sing v0.1.9-0.20230317044231-85a9429eadb6/go.mod h1:9uHswk2hITw8leDbiLS/xn0t9nzBcbePxzm9PJhwdlw=
|
||||
github.com/sagernet/sing-box v1.1.6-0.20230317050722-ce6d18634525 h1:0bJwkdiy3evkIRN1DnGYPGbFSaGl/Xn/0zeD4bVXTdo=
|
||||
github.com/sagernet/sing-box v1.1.6-0.20230317050722-ce6d18634525/go.mod h1:5x2Gj5W36tRMkPilOBhAsbsxMjKwmm5uIsSjOTFtohk=
|
||||
github.com/sagernet/sing v0.2.1-0.20230318094614-4bbf5f2c3046 h1:/+ZWbxRvQmco9ES2qT5Eh/x/IiQRjAcUyRG/vQ4dpxc=
|
||||
github.com/sagernet/sing v0.2.1-0.20230318094614-4bbf5f2c3046/go.mod h1:9uHswk2hITw8leDbiLS/xn0t9nzBcbePxzm9PJhwdlw=
|
||||
github.com/sagernet/sing-box v1.1.6-0.20230320093659-f680d0acaf15 h1:CbQaURJrnVP/hEOSTbC3CkcuGTvTfMLVD58CxJ96FIk=
|
||||
github.com/sagernet/sing-box v1.1.6-0.20230320093659-f680d0acaf15/go.mod h1:Ou1LhT7l1VUyONum6fnktOu6YOke3L13GkPyN7FS06o=
|
||||
github.com/sagernet/sing-dns v0.1.4 h1:7VxgeoSCiiazDSaXXQVcvrTBxFpOePPq/4XdgnUDN+0=
|
||||
github.com/sagernet/sing-dns v0.1.4/go.mod h1:1+6pCa48B1AI78lD+/i/dLgpw4MwfnsSpZo0Ds8wzzk=
|
||||
github.com/sagernet/sing-shadowsocks v0.1.2-0.20230221080503-769c01d6bba9 h1:qS39eA4C7x+zhEkySbASrtmb6ebdy5v0y2M6mgkmSO0=
|
||||
github.com/sagernet/sing-shadowsocks v0.1.2-0.20230221080503-769c01d6bba9/go.mod h1:f3mHTy5shnVM9l8UocMlJgC/1G/zdj5FuEuVXhDinGU=
|
||||
github.com/sagernet/sing-shadowsocks v0.2.0 h1:ILDWL7pwWfkPLEbviE/MyCgfjaBmJY/JVVY+5jhSb58=
|
||||
github.com/sagernet/sing-shadowsocks v0.2.0/go.mod h1:ysYzszRLpNzJSorvlWRMuzU6Vchsp7sd52q+JNY4axw=
|
||||
github.com/sagernet/sing-shadowtls v0.1.0 h1:05MYce8aR5xfKIn+y7xRFsdKhKt44QZTSEQW+lG5IWQ=
|
||||
github.com/sagernet/sing-shadowtls v0.1.0/go.mod h1:Kn1VUIprdkwCgkS6SXYaLmIpKzQbqBIKJBMY+RvBhYc=
|
||||
github.com/sagernet/sing-tun v0.1.3-0.20230315134716-fe89bbded22d h1:1gt4Hu2fHCrmL2NZYCNJ3nCgeczuhK09oCMni9mZmZk=
|
||||
@@ -281,6 +281,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230215201556-9c5414ab4bde h1:ybF7AMzIUikL9x4LgwEmzhXtzRpKNqngme1VGDWz+Nk=
|
||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230215201556-9c5414ab4bde/go.mod h1:mQqgjkW8GQQcJQsbBvK890TKqUK1DfKWkuBGbOkuMHQ=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
|
||||
@@ -49,7 +49,7 @@ func (s *server) Start(ctx context.Context, in *gen.LoadConfigReq) (out *gen.Err
|
||||
return
|
||||
}
|
||||
|
||||
instance, instance_cancel, err = boxmain.Create([]byte(in.CoreConfig), true)
|
||||
instance, instance_cancel, err = boxmain.Create([]byte(in.CoreConfig))
|
||||
|
||||
if instance != nil {
|
||||
// Logger
|
||||
@@ -119,7 +119,7 @@ func (s *server) Test(ctx context.Context, in *gen.TestReq) (out *gen.TestResp,
|
||||
var i *boxbox.Box
|
||||
if in.Config != nil {
|
||||
// Test instance
|
||||
i, instance_cancel, err = boxmain.Create([]byte(in.Config.CoreConfig), true)
|
||||
i, instance_cancel, err = boxmain.Create([]byte(in.Config.CoreConfig))
|
||||
if instance_cancel != nil {
|
||||
defer instance_cancel()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user