Skip to content

Commit

Permalink
Use Proxy.Host as alternative tls.server_name in sing-box to support …
Browse files Browse the repository at this point in the history
…Trojan's sni (#777)

Co-authored-by: Spade Lushen <7971040+SpadeLushen@users.noreply.github.com>
  • Loading branch information
SpadeLushen and SpadeLushen authored Aug 27, 2024
1 parent 6974910 commit 0c11565
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/generator/config/subexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2268,6 +2268,8 @@ void proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::v
tls.AddMember("enabled", true, allocator);
if (!x.ServerName.empty())
tls.AddMember("server_name", rapidjson::StringRef(x.ServerName.c_str()), allocator);
else if (!x.Host.empty())
tls.AddMember("server_name", rapidjson::StringRef(x.Host.c_str()), allocator);
tls.AddMember("insecure", buildBooleanValue(scv), allocator);
proxy.AddMember("tls", tls, allocator);
}
Expand Down

0 comments on commit 0c11565

Please sign in to comment.