Refactor: make inbound request contextual

This commit is contained in:
Dreamacro
2021-01-23 14:49:46 +08:00
parent 35925cb3da
commit f4de055aa1
19 changed files with 302 additions and 125 deletions

View File

@ -9,7 +9,7 @@ import (
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
T "github.com/Dreamacro/clash/tunnel"
"github.com/Dreamacro/clash/tunnel/statistic"
"github.com/go-chi/chi"
"github.com/go-chi/cors"
@ -143,7 +143,7 @@ func traffic(w http.ResponseWriter, r *http.Request) {
tick := time.NewTicker(time.Second)
defer tick.Stop()
t := T.DefaultManager
t := statistic.DefaultManager
buf := &bytes.Buffer{}
var err error
for range tick.C {