Fix: reject should support udp and return dial error
This commit is contained in:
parent
6ce7b6ef83
commit
9dda932494
1 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue