mirror of
https://github.com/MetaCubeX/subconverter.git
synced 2025-11-04 18:19:42 +08:00
Treat "simple-obfs" in sing-box configs as obfs-local
This commit is contained in:
parent
c578ea6318
commit
7968d54476
@ -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);
|
||||
}
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user