Skip to content

Commit

Permalink
Use Host as SNI field if exists in Surge configs (#674)
Browse files Browse the repository at this point in the history
  • Loading branch information
RuyeNet authored Nov 26, 2023
1 parent 05a542c commit fdf983b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/generator/config/subexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,10 @@ std::string proxyToSurge(std::vector<Proxy> &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())
Expand Down

0 comments on commit fdf983b

Please sign in to comment.