Skip to content

Commit

Permalink
Treat "simple-obfs" in sing-box configs as obfs-local
Browse files Browse the repository at this point in the history
  • Loading branch information
tindy2013 committed Nov 19, 2023
1 parent c578ea6 commit 7968d54
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/generator/config/subexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,8 @@ void proxyToSingBox(std::vector<Proxy> &nodes, rapidjson::Document &json, std::v
proxy.AddMember("password", rapidjson::StringRef(x.Password.c_str()), allocator);
if(!x.Plugin.empty() && !x.PluginOption.empty())
{
if (x.Plugin == "simple-obfs")
x.Plugin = "obfs-local";
proxy.AddMember("plugin", rapidjson::StringRef(x.Plugin.c_str()), allocator);
proxy.AddMember("plugin_opts", rapidjson::StringRef(x.PluginOption.c_str()), allocator);
}
Expand Down
2 changes: 1 addition & 1 deletion src/script/script_quickjs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ namespace qjs
string_icase_map res;
JSPropertyEnum *props = nullptr, *props_begin;
uint32_t len = 0;
JS_GetOwnPropertyNames(ctx, &props, &len, v, 1);
JS_GetOwnPropertyNames(ctx, &props, &len, v, JS_GPN_STRING_MASK | JS_GPN_ENUM_ONLY);
props_begin = props;
while(len > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/script/script_quickjs.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace qjs
{
static StringArray unwrap(JSContext *ctx, JSValueConst v) {
StringArray arr;
uint32_t length = unwrap_free<uint32_t>(ctx, v, "length");
auto length = unwrap_free<uint32_t>(ctx, v, "length");
for (uint32_t i = 0; i < length; i++) {
arr.push_back(JS_GetPropertyIndexToString(ctx, v, i));
}
Expand Down

0 comments on commit 7968d54

Please sign in to comment.