[Fixed]尝试修复PASS空指针问题

[Chore]调整workflows测试
This commit is contained in:
Meta
2022-03-28 16:36:34 +08:00
parent 64a5fd02da
commit ffff1418f2
5 changed files with 24 additions and 103 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,
},
}
}