diff --git a/app/proxyman/inbound/inbound.go b/app/proxyman/inbound/inbound.go index 0846b856..3c9fb467 100644 --- a/app/proxyman/inbound/inbound.go +++ b/app/proxyman/inbound/inbound.go @@ -42,6 +42,9 @@ func (m *Manager) AddHandler(ctx context.Context, handler inbound.Handler) error tag := handler.Tag() if len(tag) > 0 { + if _, found := m.taggedHandlers[tag]; found { + return newError("existing tag found: " + tag) + } m.taggedHandlers[tag] = handler } else { m.untaggedHandler = append(m.untaggedHandler, handler) diff --git a/app/proxyman/outbound/outbound.go b/app/proxyman/outbound/outbound.go index 40f98ba9..8ebcde17 100644 --- a/app/proxyman/outbound/outbound.go +++ b/app/proxyman/outbound/outbound.go @@ -109,6 +109,9 @@ func (m *Manager) AddHandler(ctx context.Context, handler outbound.Handler) erro tag := handler.Tag() if len(tag) > 0 { + if _, found := m.taggedHandler[tag]; found { + return newError("existing tag found: " + tag) + } m.taggedHandler[tag] = handler } else { m.untaggedHandlers = append(m.untaggedHandlers, handler)