From fdf983bc1b8d7a04dada7d5e215c7c9487ffffd5 Mon Sep 17 00:00:00 2001 From: RuyeNet <31236859+RuyeNet@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:14:47 +0800 Subject: [PATCH] Use Host as SNI field if exists in Surge configs (#674) --- src/generator/config/subexport.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/generator/config/subexport.cpp b/src/generator/config/subexport.cpp index bdac7a8..571115b 100644 --- a/src/generator/config/subexport.cpp +++ b/src/generator/config/subexport.cpp @@ -722,7 +722,10 @@ std::string proxyToSurge(std::vector &nodes, const std::string &base_conf case "tcp"_hash: break; case "ws"_hash: - proxy += ", ws=true, ws-path=" + path + ", sni=" + hostname; + if(host.empty()) + proxy += ", ws=true, ws-path=" + path + ", sni=" + hostname; + else + proxy += ", ws=true, ws-path=" + path + ", sni=" + host; if(!host.empty()) headers.push_back("Host:" + host); if(!edge.empty())