From 1b8a67cecb37535b3b2db04162b31e12c1f2ad18 Mon Sep 17 00:00:00 2001 From: esefxdz Date: Sat, 1 Aug 2026 22:10:48 +0300 Subject: [PATCH] less client things removal --- lib/logic/app_config.example.dart | 9 ++------- lib/logic/hivemind_service.dart | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/logic/app_config.example.dart b/lib/logic/app_config.example.dart index fed4733..ac88102 100644 --- a/lib/logic/app_config.example.dart +++ b/lib/logic/app_config.example.dart @@ -16,18 +16,13 @@ abstract final class AppConfig { static String get hivemindApiBase => 'https://$serverDomain/api'; // ── Reality (VPN tunnel) ────────────────────────────────────────────── - /// TLS camouflage — which site the Reality tunnel impersonates. - /// Server overrides this per session from REALITY_SNI_POOL. - /// www.microsoft.com — classic, never blocked - /// cloudflare.com — CDN, clean TLS - /// yandex.ru — Russian, absolutely never blocked in Russia - static const String realitySni = 'www.microsoft.com'; // ◄── REPLACE + /// The server picks a random SNI per session from REALITY_SNI_POOL. + /// The client does NOT hardcode one — server is always the source of truth. /// TLS fingerprint: chrome | firefox | safari | random static const String realityFp = 'chrome'; // These are normally overridden by /session/status response fields. - // The constants below serve as fallbacks if the server doesn't provide them. static const String vlessSecurity = 'reality'; static const String vlessType = 'tcp'; static const String vlessFlow = 'xtls-rprx-vision'; diff --git a/lib/logic/hivemind_service.dart b/lib/logic/hivemind_service.dart index e1274cd..8b8eb2f 100644 --- a/lib/logic/hivemind_service.dart +++ b/lib/logic/hivemind_service.dart @@ -72,7 +72,8 @@ class HivemindService { final vlessPort = data['vless_port'] ?? 8443; final pbk = data['reality_pbk'] ?? ''; final sid = data['reality_sid'] ?? ''; - final sni = data['reality_sni'] ?? AppConfig.realitySni; + final sni = data['reality_sni']; + if (sni == null) throw Exception('Server did not provide reality_sni'); final fp = data['reality_fp'] ?? AppConfig.realityFp; final vlessUrl = 'vless://$vlessUuid@$vlessIp:$vlessPort'