OSDN Git Service

c621e789cebad571ce32481b03f49925049a846c
[v2raya/v2raya-openwrt.git] / v2raya / patches / 0004-fix-routing-some-outboundTag-were-not-be-transformed.patch
1 From 667665ef140a11851312d33ea5a144cbad06f65b Mon Sep 17 00:00:00 2001
2 From: mzz2017 <mzz@tuta.io>
3 Date: Sun, 24 Apr 2022 21:21:56 +0800
4 Subject: [PATCH 4/4] fix(routing): some outboundTag were not be transformed to
5  balancerTag
6
7 ---
8  service/core/v2ray/v2rayTmpl.go | 15 ++++++++-------
9  1 file changed, 8 insertions(+), 7 deletions(-)
10
11 diff --git a/service/core/v2ray/v2rayTmpl.go b/service/core/v2ray/v2rayTmpl.go
12 index 1bc6881..e6f4bb0 100644
13 --- a/service/core/v2ray/v2rayTmpl.go
14 +++ b/service/core/v2ray/v2rayTmpl.go
15 @@ -1539,19 +1539,12 @@ func NewTemplate(serverInfos []serverInfo, setting *configure.Setting) (t *Templ
16                         return nil, err
17                 }
18         }
19 -       //set group routing
20 -       if err = t.setGroupRouting(serverData); err != nil {
21 -               return nil, err
22 -       }
23         //set vlessGrpc routing
24         t.setVlessGrpcRouting()
25         // set api
26         if t.API == nil {
27                 t.SetAPI()
28         }
29 -       // set spare tire outbound. Fix: https://github.com/v2rayA/v2rayA/issues/447
30 -       t.Routing.Rules = append(t.Routing.Rules, coreObj.RoutingRule{Type: "field", Network: "tcp,udp", OutboundTag: "proxy"})
31 -
32         // set routing whitelist
33         var whitelist []Addr
34         for _, info := range serverInfos {
35 @@ -1568,6 +1561,14 @@ func NewTemplate(serverInfos []serverInfo, setting *configure.Setting) (t *Templ
36  
37         t.updatePrivateRouting()
38  
39 +       // add spare tire outbound routing. Fix: https://github.com/v2rayA/v2rayA/issues/447
40 +       t.Routing.Rules = append(t.Routing.Rules, coreObj.RoutingRule{Type: "field", Network: "tcp,udp", OutboundTag: "proxy"})
41 +
42 +       // Set group routing. This should be put in the end of routing setters.
43 +       if err = t.setGroupRouting(serverData); err != nil {
44 +               return nil, err
45 +       }
46 +
47         t.optimizeGeoipMemoryOccupation()
48  
49         //set outboundSockopt
50 -- 
51 2.20.1
52