Merge remote-tracking branch 'Meta/Alpha' into Alpha

This commit is contained in:
MetaCubeX
2022-03-30 13:19:05 +08:00
14 changed files with 111 additions and 123 deletions

View File

@ -56,3 +56,13 @@ func NewCompatible() *Direct {
},
}
}
func NewPass() *Direct {
return &Direct{
Base: &Base{
name: "Pass",
tp: C.Pass,
udp: true,
},
}
}

View File

@ -1,33 +0,0 @@
package outbound
import (
"context"
"errors"
"github.com/Dreamacro/clash/component/dialer"
C "github.com/Dreamacro/clash/constant"
)
type Pass struct {
*Base
}
// DialContext implements C.ProxyAdapter
func (r *Pass) DialContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.Conn, error) {
return nil, errors.New("match Pass rule")
}
// ListenPacketContext implements C.ProxyAdapter
func (r *Pass) ListenPacketContext(ctx context.Context, metadata *C.Metadata, opts ...dialer.Option) (C.PacketConn, error) {
return nil, errors.New("match Pass rule")
}
func NewPass() *Pass {
return &Pass{
Base: &Base{
name: "PASS",
tp: C.Pass,
udp: true,
},
}
}

View File

@ -40,7 +40,8 @@ func (pp *proxySetProvider) MarshalJSON() ([]byte, error) {
"type": pp.Type().String(),
"vehicleType": pp.VehicleType().String(),
"proxies": pp.Proxies(),
"updatedAt": pp.updatedAt,
//TODO maybe error because year value overflow
"updatedAt": pp.updatedAt,
})
}