mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
API - Add | Remove Routing Rules (#3189)
* add RuleTag to routing rules * add router pb commands * add and remove routing rules api * cleanup * fix * improve error msg * add append flag apply balancer config
This commit is contained in:
parent
8a439bf3f2
commit
53e5814d19
13 changed files with 901 additions and 269 deletions
|
@ -139,6 +139,7 @@ func (c *RouterConfig) Build() (*router.Config, error) {
|
|||
}
|
||||
|
||||
type RouterRule struct {
|
||||
RuleTag string `json:"ruleTag"`
|
||||
Type string `json:"type"`
|
||||
OutboundTag string `json:"outboundTag"`
|
||||
BalancerTag string `json:"balancerTag"`
|
||||
|
@ -560,6 +561,7 @@ func parseFieldRule(msg json.RawMessage) (*router.RoutingRule, error) {
|
|||
}
|
||||
|
||||
rule := new(router.RoutingRule)
|
||||
rule.RuleTag = rawFieldRule.RuleTag
|
||||
switch {
|
||||
case len(rawFieldRule.OutboundTag) > 0:
|
||||
rule.TargetTag = &router.RoutingRule_Tag{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue