@@ -312,6 +312,9 @@ - (IBAction)showTransportSettings:(id)sender {
312
312
NSDictionary *muxSettings = [self .selectedProfile muxSettings ];
313
313
[_muxEnableButton setState: [nilCoalescing (muxSettings[@" enabled" ], @NO ) boolValue ]];
314
314
[_muxConcurrencyField setIntegerValue: [nilCoalescing (muxSettings[@" concurrency" ], @8 ) integerValue ]];
315
+ // tcp fast open
316
+ NSDictionary * tfoSettings = [transportSettings objectForKey: @" sockopt" ];
317
+ [_tfoEnableButton setState: [tfoSettings[@" tcpFastOpen" ] boolValue ]];
315
318
// proxy
316
319
/*
317
320
NSDictionary *proxySettings = [selectedProfile proxySettings];
@@ -347,6 +350,8 @@ - (IBAction)tReset:(id)sender {
347
350
// mux fields
348
351
[_muxEnableButton setState: 0 ];
349
352
[_muxEnableButton setIntegerValue: 8 ];
353
+ // tcp fast open
354
+ [_tfoEnableButton setState: 0 ];
350
355
// outbound proxy
351
356
[_proxyPortField setIntegerValue: 0 ];
352
357
[_proxyAddressField setStringValue: @" " ];
@@ -408,6 +413,14 @@ - (IBAction)tOK:(id)sender {
408
413
} else {
409
414
httpSettings = @{ @" path" : nilCoalescing ([self ->_httpPathField stringValue ], @" " ) };
410
415
}
416
+ NSDictionary *sockopt;
417
+ if ([self ->_tfoEnableButton state ]) {
418
+ sockopt = @{
419
+ @" tcpFastOpen" : [NSNumber numberWithBool: [self ->_tfoEnableButton state ] == 1 ]
420
+ };
421
+ } else {
422
+ sockopt = @{};
423
+ }
411
424
NSDictionary *streamSettings =
412
425
@{@" kcpSettings" :
413
426
@{@" mtu" :[NSNumber numberWithInteger: [self ->_kcpMtuField integerValue ]],
@@ -427,9 +440,10 @@ - (IBAction)tOK:(id)sender {
427
440
@" security" : [self ->_tlsUseButton state ] ? @" tls" : @" none" ,
428
441
@" tlsSettings" : @{
429
442
@" serverName" : nilCoalescing ([self ->_tlsSnField stringValue ], @" " ),
430
- @" allowInsecure" : [NSNumber numberWithBool: [self ->_tlsAiButton state ]==1 ],
443
+ @" allowInsecure" : [NSNumber numberWithBool: [self ->_tlsAiButton state ]==1 ]
431
444
},
432
- @" httpSettings" : httpSettings
445
+ @" httpSettings" : httpSettings,
446
+ @" sockopt" : sockopt
433
447
};
434
448
NSDictionary * muxSettings = @{
435
449
@" enabled" :[NSNumber numberWithBool: [self ->_muxEnableButton state ]==1 ],
0 commit comments