Add multiplexer

This commit is contained in:
世界
2022-07-30 00:29:22 +08:00
parent 83154eadd3
commit 457de86819
47 changed files with 1244 additions and 174 deletions

View File

@@ -15,6 +15,7 @@ import (
"github.com/sagernet/sing-box/outbound"
"github.com/sagernet/sing/common"
F "github.com/sagernet/sing/common/format"
N "github.com/sagernet/sing/common/network"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
@@ -82,7 +83,7 @@ func proxyInfo(server *Server, detour adapter.Outbound) *badjson.JSONObject {
}
info.Put("type", clashType)
info.Put("name", detour.Tag())
info.Put("udp", common.Contains(detour.Network(), C.NetworkUDP))
info.Put("udp", common.Contains(detour.Network(), N.NetworkUDP))
delayHistory := server.urlTestHistory.LoadURLTestHistory(adapter.OutboundTag(detour))
if delayHistory != nil {
info.Put("history", []*urltest.History{delayHistory})
@@ -114,7 +115,7 @@ func getProxies(server *Server, router adapter.Router) func(w http.ResponseWrite
allProxies = append(allProxies, detour.Tag())
}
defaultTag := router.DefaultOutbound(C.NetworkTCP).Tag()
defaultTag := router.DefaultOutbound(N.NetworkTCP).Tag()
if defaultTag == "" {
defaultTag = allProxies[0]
}