Skip to content

Commit 56f1692

Browse files
committed
fix(core): improve VLESS flow serialization logic for security configurations
1 parent b8a979a commit 56f1692

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

app/core/hosts.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,15 @@ async def _prepare_subscription_inbound_data(
342342
random_user_agent=host.random_user_agent,
343343
)
344344

345-
# Compute flow_enabled: only for VLESS with specific conditions
345+
# Compute flow_enabled: VLESS flow is serialized for TLS/REALITY or for
346+
# security=none when the inbound has VLESS encryption.
346347
header_type = getattr(transport_config, "header_type", "none")
348+
flow_security_enabled = tls_value in ("tls", "reality") or (
349+
tls_value in ("", "none", None) and encryption not in ("", "none", None)
350+
)
347351
flow_enabled = (
348352
protocol == "vless"
349-
and tls_value in ("tls", "reality")
353+
and flow_security_enabled
350354
and network in ("tcp", "raw", "kcp")
351355
and header_type != "http"
352356
)

0 commit comments

Comments
 (0)