Skip to content

Commit

Permalink
feat: add x-ignore-node field, avoid destroying the custom outbound…
Browse files Browse the repository at this point in the history
… vless config
  • Loading branch information
tzmax committed Feb 2, 2025
1 parent 87020c1 commit 017f0c0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions V2RayX/ConfigWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,16 @@ - (void)windowDidLoad {

for (NSDictionary *p in _appDelegate.profiles) {
// this old conditions is [@"vmess" isEqualToString:p[@"protocol"]] && [p[@"settings"][@"vnext"] count] == 1
NSLog(@"protocol: %@", p[@"protocol"]);
if (([@"vmess" isEqualToString:p[@"protocol"]] || [@"vless" isEqualToString:p[@"protocol"]]) && [p[@"settings"][@"vnext"] count] == 1) {
// NSLog(@"protocol: %@", p[@"protocol"]);
// add `x-ignore-node` field, avoid destroying the custom outbounds vless config
BOOL isIgnoreNode = NO;
if ([p objectForKey:@"x-ignore-node"]) {
isIgnoreNode = YES;
}
if (([@"vmess" isEqualToString:p[@"protocol"]] || [@"vless" isEqualToString:p[@"protocol"]]) &&
[p[@"settings"][@"vnext"] count] == 1 &&
!isIgnoreNode
) {
[_profiles addObject:[ServerProfile profilesFromJson:p][0]];
} else {
[_outbounds addObject:p];
Expand Down

0 comments on commit 017f0c0

Please sign in to comment.