Add connection from lan option

This commit is contained in:
problematicconsumer
2024-01-01 19:14:28 +03:30
parent b117ab0372
commit 800efe6b43
10 changed files with 18 additions and 0 deletions

View File

@@ -216,6 +216,7 @@
"directDnsDomainStrategy": "Direct DNS Domain Strategy",
"mixedPort": "Mixed Port",
"localDnsPort": "Local DNS Port",
"allowConnectionFromLan": "Allow Connection from LAN",
"tunImplementation": "TUN Implementation",
"mtu": "MTU",
"connectionTestUrl": "Connection Test URL",

View File

@@ -216,6 +216,7 @@
"directDnsDomainStrategy": "حالت DNS مستقیم",
"mixedPort": "پورت همه منظوره",
"localDnsPort": "پورت DNS داخلی",
"allowConnectionFromLan": "Allow Connection from LAN",
"tunImplementation": "مدل تونل",
"mtu": "سایز بسته‌ها",
"connectionTestUrl": "لینک تست اتصال",

View File

@@ -214,6 +214,7 @@
"directDnsDomainStrategy": "Стратегия прямого домена DNS",
"mixedPort": "Смешанный порт",
"localDnsPort": "Локальный порт DNS",
"allowConnectionFromLan": "Allow Connection from LAN",
"tunImplementation": "Реализация TUN",
"mtu": "MTU",
"connectionTestUrl": "URL проверки подключения",

View File

@@ -214,6 +214,7 @@
"directDnsDomainStrategy": "Doğrudan DNS Domain Stratejisi",
"mixedPort": "Mixed Port",
"localDnsPort": "Yerel DNS Bağlantı Noktası",
"allowConnectionFromLan": "Allow Connection from LAN",
"tunImplementation": "TUN İmplementasyonu",
"mtu": "MTU",
"connectionTestUrl": "Bağlantı Testi URL'i",

View File

@@ -214,6 +214,7 @@
"directDnsDomainStrategy": "直连 DNS 域名策略",
"mixedPort": "混合端口",
"localDnsPort": "本地 DNS 端口",
"allowConnectionFromLan": "Allow Connection from LAN",
"tunImplementation": "TUN 实现",
"mtu": "MTU",
"connectionTestUrl": "连接测试网址",

View File

@@ -103,6 +103,7 @@ class ConfigOptionRepositoryImpl
enableTun: persisted.serviceMode == ServiceMode.tun,
setSystemProxy: persisted.serviceMode == ServiceMode.systemProxy,
bypassLan: persisted.bypassLan,
allowConnectionFromLan: persisted.allowConnectionFromLan,
enableFakeDns: persisted.enableFakeDns,
enableDnsRouting: persisted.enableDnsRouting,
independentDnsCache: persisted.independentDnsCache,

View File

@@ -37,6 +37,7 @@ class ConfigOptionEntity with _$ConfigOptionEntity {
@Default(true) bool enableClashApi,
@Default(6756) int clashApiPort,
@Default(false) bool bypassLan,
@Default(false) bool allowConnectionFromLan,
@Default(false) bool enableFakeDns,
@Default(true) bool enableDnsRouting,
@Default(true) bool independentDnsCache,
@@ -96,6 +97,8 @@ class ConfigOptionEntity with _$ConfigOptionEntity {
enableClashApi: patch.enableClashApi ?? enableClashApi,
clashApiPort: patch.clashApiPort ?? clashApiPort,
bypassLan: patch.bypassLan ?? bypassLan,
allowConnectionFromLan:
patch.allowConnectionFromLan ?? allowConnectionFromLan,
enableFakeDns: patch.enableFakeDns ?? enableFakeDns,
enableDnsRouting: patch.enableDnsRouting ?? enableDnsRouting,
independentDnsCache: patch.independentDnsCache ?? independentDnsCache,

View File

@@ -31,6 +31,7 @@ class ConfigOptionPatch with _$ConfigOptionPatch {
bool? enableClashApi,
int? clashApiPort,
bool? bypassLan,
bool? allowConnectionFromLan,
bool? enableFakeDns,
bool? enableDnsRouting,
bool? independentDnsCache,

View File

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

View File

@@ -35,6 +35,7 @@ class SingboxConfigOption with _$SingboxConfigOption {
required bool enableTun,
required bool setSystemProxy,
required bool bypassLan,
required bool allowConnectionFromLan,
required bool enableFakeDns,
required bool enableDnsRouting,
required bool independentDnsCache,