From 9dda9324947ffce869b10aa6e34a1d51bc030b06 Mon Sep 17 00:00:00 2001 From: Dreamacro <305009791@qq.com> Date: Mon, 30 Dec 2019 10:51:35 +0800 Subject: [PATCH] Fix: reject should support udp and return dial error --- adapters/outbound/reject.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adapters/outbound/reject.go b/adapters/outbound/reject.go index b0535082..5ef61540 100644 --- a/adapters/outbound/reject.go +++ b/adapters/outbound/reject.go @@ -2,6 +2,7 @@ package outbound import ( "context" + "errors" "io" "net" "time" @@ -17,11 +18,16 @@ func (r *Reject) DialContext(ctx context.Context, metadata *C.Metadata) (C.Conn, return newConn(&NopConn{}, r), nil } +func (r *Reject) DialUDP(metadata *C.Metadata) (C.PacketConn, net.Addr, error) { + return nil, nil, errors.New("match reject rule") +} + func NewReject() *Reject { return &Reject{ Base: &Base{ name: "REJECT", tp: C.Reject, + udp: true, }, } }