Add dns routing option

This commit is contained in:
problematicconsumer
2024-01-01 19:01:36 +03:30
parent 7262ff89b7
commit b117ab0372
10 changed files with 17 additions and 0 deletions

View File

@@ -104,6 +104,7 @@ class ConfigOptionRepositoryImpl
setSystemProxy: persisted.serviceMode == ServiceMode.systemProxy,
bypassLan: persisted.bypassLan,
enableFakeDns: persisted.enableFakeDns,
enableDnsRouting: persisted.enableDnsRouting,
independentDnsCache: persisted.independentDnsCache,
enableTlsFragment: persisted.enableTlsFragment,
tlsFragmentSize: persisted.tlsFragmentSize,

View File

@@ -38,6 +38,7 @@ class ConfigOptionEntity with _$ConfigOptionEntity {
@Default(6756) int clashApiPort,
@Default(false) bool bypassLan,
@Default(false) bool enableFakeDns,
@Default(true) bool enableDnsRouting,
@Default(true) bool independentDnsCache,
@Default(false) bool enableTlsFragment,
@RangeWithOptionalCeilJsonConverter()
@@ -96,6 +97,7 @@ class ConfigOptionEntity with _$ConfigOptionEntity {
clashApiPort: patch.clashApiPort ?? clashApiPort,
bypassLan: patch.bypassLan ?? bypassLan,
enableFakeDns: patch.enableFakeDns ?? enableFakeDns,
enableDnsRouting: patch.enableDnsRouting ?? enableDnsRouting,
independentDnsCache: patch.independentDnsCache ?? independentDnsCache,
enableTlsFragment: patch.enableTlsFragment ?? enableTlsFragment,
tlsFragmentSize: patch.tlsFragmentSize ?? tlsFragmentSize,

View File

@@ -32,6 +32,7 @@ class ConfigOptionPatch with _$ConfigOptionPatch {
int? clashApiPort,
bool? bypassLan,
bool? enableFakeDns,
bool? enableDnsRouting,
bool? independentDnsCache,
bool? enableTlsFragment,
@RangeWithOptionalCeilJsonConverter()

View File

@@ -174,6 +174,13 @@ class ConfigOptionsPage extends HookConsumerWidget {
);
},
),
SwitchListTile(
title: Text(t.settings.config.enableDnsRouting),
value: options.enableDnsRouting,
onChanged: (value) => changeOption(
ConfigOptionPatch(enableDnsRouting: value),
),
),
const SettingsDivider(),
SettingsSection(t.settings.config.section.inbound),
ListTile(