mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 01:08:33 +00:00
Log: show the matching rule tag (#3809)
This commit is contained in:
parent
88ae774cce
commit
7970f240de
4 changed files with 19 additions and 3 deletions
|
@ -34,6 +34,7 @@ type Route struct {
|
|||
routing.Context
|
||||
outboundGroupTags []string
|
||||
outboundTag string
|
||||
ruleTag string
|
||||
}
|
||||
|
||||
// Init initializes the Router.
|
||||
|
@ -89,7 +90,7 @@ func (r *Router) PickRoute(ctx routing.Context) (routing.Route, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &Route{Context: ctx, outboundTag: tag}, nil
|
||||
return &Route{Context: ctx, outboundTag: tag, ruleTag: rule.RuleTag}, nil
|
||||
}
|
||||
|
||||
// AddRule implements routing.Router.
|
||||
|
@ -239,6 +240,10 @@ func (r *Route) GetOutboundTag() string {
|
|||
return r.outboundTag
|
||||
}
|
||||
|
||||
func (r *Route) GetRuleTag() string {
|
||||
return r.ruleTag
|
||||
}
|
||||
|
||||
func init() {
|
||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
||||
r := new(Router)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue