Add v2ray stats api

This commit is contained in:
世界
2022-09-26 19:37:06 +08:00
parent c7a485815c
commit 1b44faed17
32 changed files with 1408 additions and 64 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/sagernet/sing-box/common/json"
"github.com/sagernet/sing-box/common/urltest"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/experimental"
"github.com/sagernet/sing-box/experimental/clashapi/cachefile"
"github.com/sagernet/sing-box/experimental/clashapi/trafficontrol"
"github.com/sagernet/sing-box/log"
@@ -29,6 +30,12 @@ import (
"github.com/go-chi/render"
)
func init() {
experimental.RegisterClashServerConstructor(func(router adapter.Router, logFactory log.ObservableFactory, options option.ClashAPIOptions) (adapter.ClashServer, error) {
return NewServer(router, logFactory, options)
})
}
var _ adapter.ClashServer = (*Server)(nil)
type Server struct {