Feature: add experimental connections API

This commit is contained in:
Dreamacro
2019-10-27 21:44:07 +08:00
parent 52cfa94652
commit 207371aeae
16 changed files with 365 additions and 130 deletions

View File

@ -67,6 +67,7 @@ func Start(addr string, secret string) {
r.Mount("/configs", configRouter())
r.Mount("/proxies", proxyRouter())
r.Mount("/rules", ruleRouter())
r.Mount("/connections", connectionRouter())
})
if uiPath != "" {
@ -140,7 +141,7 @@ func traffic(w http.ResponseWriter, r *http.Request) {
}
tick := time.NewTicker(time.Second)
t := T.Instance().Traffic()
t := T.DefaultManager
buf := &bytes.Buffer{}
var err error
for range tick.C {