Merge branch 'dev' of https://github.com/Dreamacro/clash into Alpha

This commit is contained in:
wwqgtxx
2022-11-12 20:43:48 +08:00
51 changed files with 641 additions and 742 deletions

View File

@ -119,7 +119,7 @@ type Metadata struct {
InPort string `json:"inboundPort"`
Host string `json:"host"`
DNSMode DNSMode `json:"dnsMode"`
Uid *int32 `json:"uid"`
Uid *uint32 `json:"uid"`
Process string `json:"process"`
ProcessPath string `json:"processPath"`
RemoteDst string `json:"remoteDestination"`

View File

@ -1,16 +0,0 @@
package mime
import (
"mime"
)
var consensusMimes = map[string]string{
// rfc4329: text/javascript is obsolete, so we need to overwrite mime's builtin
".js": "application/javascript; charset=utf-8",
}
func init() {
for ext, typ := range consensusMimes {
mime.AddExtensionType(ext, typ)
}
}

View File

@ -1,7 +1,7 @@
package provider
import (
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/constant"
)
// Vehicle Type
@ -65,7 +65,9 @@ type Provider interface {
// ProxyProvider interface
type ProxyProvider interface {
Provider
Proxies() []C.Proxy
Proxies() []constant.Proxy
// Touch is used to inform the provider that the proxy is actually being used while getting the list of proxies.
// Commonly used in DialContext and DialPacketConn
Touch()
HealthCheck()
Version() uint32
@ -98,7 +100,7 @@ func (rt RuleType) String() string {
type RuleProvider interface {
Provider
Behavior() RuleType
Match(*C.Metadata) bool
Match(*constant.Metadata) bool
ShouldResolveIP() bool
AsRule(adaptor string) C.Rule
AsRule(adaptor string) constant.Rule
}