Merge from remote branch

This commit is contained in:
yaling888
2022-02-23 01:00:27 +08:00
79 changed files with 1071 additions and 542 deletions

View File

@ -79,15 +79,7 @@ func patchConfigs(w http.ResponseWriter, r *http.Request) {
P.ReCreateMixed(pointerOrDefault(general.MixedPort, ports.MixedPort), tcpIn, udpIn)
if general.Tun != nil {
err := P.ReCreateTun(*general.Tun, nil, nil)
if err == nil {
log.Infoln("Recreate tun success.")
} else {
log.Errorln("Recreate tun failed: %s", err.Error())
render.Status(r, http.StatusBadRequest)
render.JSON(w, r, newError(err.Error()))
return
}
P.ReCreateTun(*general.Tun, tcpIn, udpIn)
}
if general.Mode != nil {

View File

@ -9,6 +9,7 @@ import (
"time"
C "github.com/Dreamacro/clash/constant"
_ "github.com/Dreamacro/clash/constant/mime"
"github.com/Dreamacro/clash/log"
"github.com/Dreamacro/clash/tunnel/statistic"