Browse Source

luci-app-ssr-plus: adapt simple-obfs plugin

Some proxies providers may use "simple-obfs" instead of "obfs-local",
make it compatible.

Signed-off-by: Tianling Shen <[email protected]>
Tianling Shen 4 years ago
parent
commit
470d978661
1 changed files with 6 additions and 1 deletions
  1. 6 1
      luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua

+ 6 - 1
luci-app-ssr-plus/root/usr/share/shadowsocksr/subscribe.lua

@@ -239,6 +239,10 @@ local function processData(szType, content)
 				else
 				else
 					result.plugin = plugin_info
 					result.plugin = plugin_info
 				end
 				end
+				-- 部分机场下发的插件名为 simple-obfs,这里应该改为 obfs-local
+				if result.plugin == "simple-obfs" then
+					result.plugin = "obfs-local"
+				end
 			end
 			end
 		else
 		else
 			result.server_port = host[2]
 			result.server_port = host[2]
@@ -260,8 +264,9 @@ local function processData(szType, content)
 		result.plugin_opts = content.plugin_options
 		result.plugin_opts = content.plugin_options
 		result.alias = "[" .. content.airport .. "] " .. content.remarks
 		result.alias = "[" .. content.airport .. "] " .. content.remarks
 		if checkTabValue(encrypt_methods_ss)[result.encrypt_method_ss] then
 		if checkTabValue(encrypt_methods_ss)[result.encrypt_method_ss] then
-			-- 1202 年了还不支持 SS AEAD 的屑机场
 			result.server = nil
 			result.server = nil
+		elseif result.plugin == "simple-obfs" then
+			result.plugin = "obfs-local"
 		end
 		end
 	elseif szType == "trojan" then
 	elseif szType == "trojan" then
 		local idx_sp = 0
 		local idx_sp = 0