refactor: Extract clash/v2ray/time service form router

This commit is contained in:
世界
2024-11-10 16:46:59 +08:00
parent 1df8dfcade
commit b4f1c2a596
25 changed files with 299 additions and 465 deletions

View File

@@ -49,11 +49,7 @@ func (s *CommandServer) handleConnectionsConn(conn net.Conn) error {
for {
service := s.service
if service != nil {
clashServer := service.instance.Router().ClashServer()
if clashServer == nil {
return E.New("Clash API disabled")
}
trafficManager = clashServer.(*clashapi.Server).TrafficManager()
trafficManager = service.clashServer.(*clashapi.Server).TrafficManager()
break
}
select {