Fix clash tracker

This commit is contained in:
世界
2022-10-01 09:56:09 +08:00
parent 1173fdea64
commit 29d08e63b5
4 changed files with 128 additions and 12 deletions

View File

@@ -31,9 +31,7 @@ import (
)
func init() {
experimental.RegisterClashServerConstructor(func(router adapter.Router, logFactory log.ObservableFactory, options option.ClashAPIOptions) (adapter.ClashServer, error) {
return NewServer(router, logFactory, options)
})
experimental.RegisterClashServerConstructor(NewServer)
}
var _ adapter.ClashServer = (*Server)(nil)
@@ -51,7 +49,7 @@ type Server struct {
cacheFile adapter.ClashCacheFile
}
func NewServer(router adapter.Router, logFactory log.ObservableFactory, options option.ClashAPIOptions) (*Server, error) {
func NewServer(router adapter.Router, logFactory log.ObservableFactory, options option.ClashAPIOptions) (adapter.ClashServer, error) {
trafficManager := trafficontrol.NewManager()
chiRouter := chi.NewRouter()
server := &Server{