[Refactor]

1.allow maybe empty group
2.use COMPATIBLE(DIRECT alias) when proxy group is empty
3.http provider pass through tunnel
This commit is contained in:
Skyxim
2022-01-18 21:09:36 +08:00
parent ee6c1871a9
commit b15344ec78
17 changed files with 135 additions and 50 deletions

View File

@ -13,7 +13,7 @@ import (
const (
Direct AdapterType = iota
Reject
Compatible
Shadowsocks
ShadowsocksR
Snell
@ -128,7 +128,8 @@ func (at AdapterType) String() string {
return "Direct"
case Reject:
return "Reject"
case Compatible:
return "Compatible"
case Shadowsocks:
return "Shadowsocks"
case ShadowsocksR:

View File

@ -24,6 +24,7 @@ const (
REDIR
TPROXY
TUN
INNER
)
type NetWork int
@ -59,6 +60,8 @@ func (t Type) String() string {
return "TProxy"
case TUN:
return "Tun"
case INNER:
return "Inner"
default:
return "Unknown"
}
@ -94,6 +97,10 @@ func (m *Metadata) SourceDetail() string {
if m.Process != "" {
return fmt.Sprintf("%s(%s)", m.SourceAddress(), m.Process)
} else {
if m.Type == INNER {
return fmt.Sprintf("[Clash]")
}
return fmt.Sprintf("%s", m.SourceAddress())
}
}