Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 375fc8a

Browse files
committed
add mux; core update
1 parent 7806cfb commit 375fc8a

7 files changed

+96
-45
lines changed

V2RayX/ConfigWindowController.h

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
//tls fields
4949
@property (weak) IBOutlet NSButton *tlsUseButton;
5050
@property (weak) IBOutlet NSButton *tlsAiButton;
51+
//mux fields
52+
@property (weak) IBOutlet NSButton *muxEnableButton;
53+
@property (weak) IBOutlet NSTextField *muxConcurrencyField;
54+
5155

5256
@property (nonatomic) ServerProfile* selectedProfile;
5357
@property NSInteger selectedServerIndex;

V2RayX/ConfigWindowController.m

+18
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ - (IBAction)showtransportSettings:(id)sender {
132132
[_kcpDcField setFormatter:formatter];
133133
[_kcpRbField setFormatter:formatter];
134134
[_kcpWbField setFormatter:formatter];
135+
[_muxConcurrencyField setFormatter:formatter];
135136
//read settings
136137
NSDictionary *transportSettings = [[NSUserDefaults standardUserDefaults] objectForKey:@"transportSettings"];
137138
//kcp
@@ -162,6 +163,17 @@ - (IBAction)showtransportSettings:(id)sender {
162163
NSDictionary* tlsSettings = [[NSUserDefaults standardUserDefaults] objectForKey:@"tlsSettings"];
163164
[_tlsAiButton setState:[tlsSettings[@"allowInsecure"] boolValue]];
164165
[self useTLS:nil];
166+
// mux
167+
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
168+
if ([defaults objectForKey:@"mux"] != nil) {
169+
NSNumber* enableDefault = [[defaults objectForKey:@"mux"] objectForKey:@"enable"];
170+
NSNumber* concurrencyDefault = [[defaults objectForKey:@"mux"] objectForKey:@"concurrency"];
171+
[_muxEnableButton setState:enableDefault==nil?NO:[enableDefault boolValue]];
172+
[_muxConcurrencyField setIntegerValue:concurrencyDefault==nil?8:[concurrencyDefault integerValue]];
173+
} else {
174+
[_muxEnableButton setState:NO];
175+
[_muxConcurrencyField setIntegerValue:8];
176+
}
165177
//show sheet
166178
[[self window] beginSheet:_transportWindow completionHandler:^(NSModalResponse returnCode) {
167179
}];
@@ -183,6 +195,9 @@ - (IBAction)tReset:(id)sender {
183195
//ws fields
184196
[_wsCrButton setState:1];
185197
[_wsPathField setStringValue:@""];
198+
//mux fields
199+
[_muxEnableButton setState:0];
200+
[_muxEnableButton setIntegerValue:8];
186201

187202

188203
}
@@ -221,6 +236,9 @@ - (IBAction)tOK:(id)sender {
221236
[defaults setObject:transportSettings forKey:@"transportSettings"];
222237
[defaults setObject:[NSNumber numberWithBool:[_tlsUseButton state]] forKey:@"useTLS"];
223238
[defaults setObject:@{@"allowInsecure": [NSNumber numberWithBool:[_tlsAiButton state]]} forKey:@"tlsSettings"];
239+
[defaults setObject:@{@"enable":[NSNumber numberWithBool:[_muxEnableButton state]],
240+
@"concurrency":[NSNumber numberWithInteger:[_muxConcurrencyField integerValue]]
241+
} forKey:@"mux"];
224242
//close sheet
225243
[[self window] endSheet:_transportWindow];
226244
}

V2RayX/ServerProfile.m

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ - (NSDictionary*)v2rayConfigWithRules:(BOOL)rules
4949
config[@"inbound"][@"listen"] = [[userDefaults objectForKey:@"shareOverLan"] boolValue] ? @"0.0.0.0" : @"127.0.0.1";
5050
config[@"inbound"][@"settings"][@"udp"] = config[@"udpSupport"];
5151
config[@"inbound"][@"allowPassive"] = [self allowPassive];
52+
if ([userDefaults objectForKey:@"mux"] != nil) {
53+
config[@"outbound"][@"mux"] = [userDefaults objectForKey:@"mux"];
54+
}
5255
config[@"outbound"][@"settings"][@"vnext"][0][@"address"] = self.address;
5356
config[@"outbound"][@"settings"][@"vnext"][0][@"port"] = self.port;
5457
config[@"outbound"][@"settings"][@"vnext"][0][@"users"][0][@"id"] = self.userId;

V2RayX/config-sample-rules.plist

+6-11
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
</dict>
3737
<key>outbound</key>
3838
<dict>
39+
<key>mux</key>
40+
<dict>
41+
<key>enabled</key>
42+
<false/>
43+
</dict>
3944
<key>protocol</key>
4045
<string>vmess</string>
4146
<key>settings</key>
@@ -53,7 +58,7 @@
5358
<key>alterId</key>
5459
<integer>64</integer>
5560
<key>id</key>
56-
<string>23ad6b10-8d1a-40f7-8ad0-e3e35cd38297</string>
61+
<string>a3482e88-686a-4a58-8126-99c9df64b7bf</string>
5762
<key>security</key>
5863
<string>auto</string>
5964
</dict>
@@ -154,15 +159,5 @@
154159
<key>strategy</key>
155160
<string>rules</string>
156161
</dict>
157-
<key>transport</key>
158-
<dict>
159-
<key>kcpSettings</key>
160-
<dict>
161-
<key>downlinkCapacity</key>
162-
<integer>10</integer>
163-
<key>uplinkCapacity</key>
164-
<integer>1</integer>
165-
</dict>
166-
</dict>
167162
</dict>
168163
</plist>

V2RayX/config-sample.plist

+6-11
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
</dict>
3737
<key>outbound</key>
3838
<dict>
39+
<key>mux</key>
40+
<dict>
41+
<key>enabled</key>
42+
<false/>
43+
</dict>
3944
<key>protocol</key>
4045
<string>vmess</string>
4146
<key>settings</key>
@@ -53,7 +58,7 @@
5358
<key>alterId</key>
5459
<integer>64</integer>
5560
<key>id</key>
56-
<string>23ad6b10-8d1a-40f7-8ad0-e3e35cd38297</string>
61+
<string>a3482e88-686a-4a58-8126-99c9df64b7bf</string>
5762
<key>security</key>
5863
<string>auto</string>
5964
</dict>
@@ -142,15 +147,5 @@
142147
<key>strategy</key>
143148
<string>rules</string>
144149
</dict>
145-
<key>transport</key>
146-
<dict>
147-
<key>kcpSettings</key>
148-
<dict>
149-
<key>downlinkCapacity</key>
150-
<integer>10</integer>
151-
<key>uplinkCapacity</key>
152-
<integer>1</integer>
153-
</dict>
154-
</dict>
155150
</dict>
156151
</plist>

V2RayX/dlcore.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION="v2.20.2"
1+
VERSION="v2.33"
22

33

44
cd $SRCROOT

0 commit comments

Comments
 (0)