From 7f0e2f801d4cad483774748b0471c190df2cb2e1 Mon Sep 17 00:00:00 2001 From: Tanbir Hossen <83357881+Bluefishx@users.noreply.github.com> Date: Mon, 25 May 2026 16:01:21 +0600 Subject: [PATCH] fix: migrate wsSettings host from deprecated headers.Host to independent host field (#5686) * fix: migrate wsSettings host from deprecated headers.Host to independent host field fix: migrate wsSettings host out of deprecated headers field - Add independent `host` field to WsSettingsBean - Replace HeadersBean with Map? to match Xray docs - Update CoreOutboundBuilder to use wssetting.host instead of wssetting.headers.Host * fix: migrate wsSettings host from deprecated headers.Host to independent host field fix: migrate wsSettings host out of deprecated headers field - Add independent `host` field to WsSettingsBean - Replace HeadersBean with Map? to match Xray docs - Update CoreOutboundBuilder to use wssetting.host instead of wssetting.headers.Host --- .../main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt | 4 ++-- V2rayNG/app/src/main/java/com/v2ray/ang/dto/V2rayConfig.kt | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt index c4514eae..15bdbfec 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/core/CoreOutboundBuilder.kt @@ -410,7 +410,7 @@ object CoreOutboundBuilder { NetworkType.WS.type -> { val wssetting = OutboundBean.StreamSettingsBean.WsSettingsBean() - wssetting.headers.Host = host.orEmpty() + wssetting.host = host.orEmpty() sni = host wssetting.path = path ?: "/" streamSettings.wsSettings = wssetting @@ -685,4 +685,4 @@ object CoreOutboundBuilder { } return resolvedIps.first() } -} \ No newline at end of file +} diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/dto/V2rayConfig.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/dto/V2rayConfig.kt index c13706e9..f484a3a7 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/dto/V2rayConfig.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/dto/V2rayConfig.kt @@ -197,13 +197,12 @@ data class V2rayConfig( data class WsSettingsBean( var path: String? = null, - var headers: HeadersBean = HeadersBean(), + var host: String? = null, + var headers: Map? = null, val maxEarlyData: Int? = null, val useBrowserForwarding: Boolean? = null, val acceptProxyProtocol: Boolean? = null - ) { - data class HeadersBean(var Host: String = "") - } + ) data class HttpupgradeSettingsBean( var path: String? = null,