decoy host into lib

This commit is contained in:
2026-07-02 18:43:26 +07:00
parent 820d23abd9
commit 8d9dfeee41
2 changed files with 11 additions and 4 deletions
+7 -1
View File
@@ -107,9 +107,14 @@ impl SessionManager {
/// Создаёт TUN (из переданного `_tun_fd` на мобильных или сам на Linux),
/// конфигурирует движок (MTU, kill-switch, исключения) и запускает его в
/// общем рантайме под токеном отмены. Не блокирует вызывающий поток.
///
/// `sni` — домен-декой для `ClientHello` этого сервера; приложение берёт
/// его из [`known_servers`] по выбранному `remote_address` (в будущем —
/// из бэкенда вместе с остальными полями узла).
pub fn spawn_session(
&self,
remote_address: String,
sni: String,
_tun_fd: Option<i32>,
cache_dir: String,
killswitch_enabled: bool,
@@ -130,7 +135,8 @@ impl SessionManager {
.with_cache_path(&cache_dir)
.with_killswitch(killswitch_enabled)
.with_excluded_apps(excluded_apps)
.with_excluded_domains(excluded_domains);
.with_excluded_domains(excluded_domains)
.with_decoy_sni(sni);
#[cfg(any(target_os = "android", target_os = "ios"))]
{
+4 -3
View File
@@ -9,10 +9,11 @@ dictionary VpnTrafficStats {
interface SessionManager {
constructor();
// Добавлены параметры для Killswitch и исключений
// Добавлены параметры для Killswitch и исключений, и sni (декой ClientHello)
Session spawn_session(
string remote_address,
i32? tun_fd,
string remote_address,
string sni,
i32? tun_fd,
string cache_path,
boolean killswitch_enabled,
sequence<string> excluded_apps,