add Close() for relay handler

This commit is contained in:
ginuerzh
2023-01-17 22:11:05 +08:00
parent 834c6447ca
commit 40360f0c6f
2 changed files with 12 additions and 0 deletions

View File

@ -220,6 +220,14 @@ func (h *relayHandler) Handle(ctx context.Context, conn net.Conn, opts ...handle
}
}
// Close implements io.Closer interface.
func (h *relayHandler) Close() error {
if h.ep != nil {
return h.ep.Close()
}
return nil
}
func (h *relayHandler) checkRateLimit(addr net.Addr) bool {
if h.options.RateLimiter == nil {
return true