luci-app-ssr-plus: bump to 182-2
This commit is contained in:
parent
8ea8e4be95
commit
55464b32a5
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-ssr-plus
|
||||
PKG_VERSION:=182
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/shadowsocksr
|
||||
@ -10,10 +10,6 @@ define Package/$(PKG_NAME)/conffiles
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin
|
||||
bool "Include Shadowsocks V2ray Plugin"
|
||||
default y if i386||x86_64||arm||aarch64
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Xray
|
||||
bool "Include Xray"
|
||||
default y if i386||x86_64||arm||aarch64
|
||||
@ -35,10 +31,18 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
|
||||
bool "Include V2ray"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Go
|
||||
bool "Include Trojan-Go"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
|
||||
bool "Include Kcptun"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin
|
||||
bool "Include Shadowsocks V2ray Plugin"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
|
||||
bool "Include ShadowsocksR Server"
|
||||
default y if i386||x86_64||arm||aarch64
|
||||
@ -49,6 +53,7 @@ PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Xray \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Go \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Redsocks2 \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun \
|
||||
@ -62,6 +67,7 @@ LUCI_DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsm
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Go:trojan-go \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:ipt2socks \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy:naiveproxy \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Redsocks2:redsocks2 \
|
||||
|
||||
@ -59,12 +59,11 @@ function act_ping()
|
||||
end
|
||||
|
||||
function check_status()
|
||||
local retstring = "1"
|
||||
local set = "/usr/bin/ssr-check www." .. luci.http.formvalue("set") .. ".com 80 3 1"
|
||||
sret = luci.sys.call(set)
|
||||
if sret == 0 then
|
||||
retstring = "0"
|
||||
else
|
||||
retstring = "1"
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ret = retstring})
|
||||
@ -72,9 +71,9 @@ end
|
||||
|
||||
function refresh_data()
|
||||
local set = luci.http.formvalue("set")
|
||||
local retstring = luci.sys.exec("/usr/bin/lua /usr/share/shadowsocksr/update.lua " .. set)
|
||||
local retstring = loadstring("return " .. luci.sys.exec("/usr/bin/lua /usr/share/shadowsocksr/update.lua " .. set))()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ret = tonumber(retstring)})
|
||||
luci.http.write_json(retstring)
|
||||
end
|
||||
|
||||
function check_port()
|
||||
|
||||
@ -56,11 +56,11 @@ o:depends("adblock", "1")
|
||||
o.description = translate("Support AdGuardHome and DNSMASQ format list")
|
||||
|
||||
o = s:option(Value, "gfwlist_url", translate("gfwlist Update url"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/v2fly/domain-list-community@release/gfwlist.txt", translate("v2fly/domain-list-community"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt", translate("v2fly/domain-list-community"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/gfw.txt", translate("Loyalsoldier/v2ray-rules-dat"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/Loukky/gfwlist-by-loukky/gfwlist.txt", translate("Loukky/gfwlist-by-loukky"))
|
||||
o:value("https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt", translate("gfwlist/gfwlist"))
|
||||
o.default = "https://cdn.jsdelivr.net/gh/v2fly/domain-list-community@release/gfwlist.txt"
|
||||
o.default = "https://cdn.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt"
|
||||
|
||||
o = s:option(Value, "chnroute_url", translate("Chnroute Update url"))
|
||||
o:value("https://ispip.clang.cn/all_cn.txt", translate("Clang.CN"))
|
||||
|
||||
@ -139,7 +139,7 @@ if nixio.fs.access("/usr/bin/xray") or nixio.fs.access("/usr/bin/v2ray") then
|
||||
o:value("vmess", translate("Vmess"))
|
||||
o:value("vless", translate("VLESS"))
|
||||
end
|
||||
if nixio.fs.access("/usr/sbin/trojan") then
|
||||
if nixio.fs.access("/usr/sbin/trojan") or nixio.fs.access("/usr/bin/trojan-go") then
|
||||
o:value("trojan", translate("Trojan"))
|
||||
end
|
||||
if nixio.fs.access("/usr/bin/naive") then
|
||||
@ -219,7 +219,7 @@ o:depends("type", "ss")
|
||||
|
||||
-- Shadowsocks Plugin
|
||||
o = s:option(ListValue, "plugin", translate("Obfs"))
|
||||
o:value("", translate("None"))
|
||||
o:value("none", translate("None"))
|
||||
if nixio.fs.access("/usr/bin/obfs-local") then
|
||||
o:value("obfs-local", translate("simple-obfs"))
|
||||
end
|
||||
@ -229,24 +229,10 @@ end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "simple_obfs", translate("Plugin Opts"))
|
||||
o:value("obfs=tls;obfs-host=", translate("TLS"))
|
||||
o:value("obfs=http;obfs-host=", translate("HTTP"))
|
||||
o:depends("plugin", "obfs-local")
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(ListValue, "v2ray_plugin", translate("Plugin Opts"))
|
||||
o:value("tls;host=", translate("TLS"))
|
||||
o:value("mode=quic;host=", translate("QUIC"))
|
||||
o:value("none", translate("HTTP"))
|
||||
o:depends("plugin", "v2ray-plugin")
|
||||
o.rmempty = true
|
||||
|
||||
o = s:option(Value, "plugin_opts", translate("Plugin Opts"), translate("Please fill in the Host, for example: www.baidu.com"))
|
||||
o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
|
||||
o.rmempty = true
|
||||
o:depends({type = "ss", plugin = "obfs-local"})
|
||||
o:depends({type = "ss", v2ray_plugin = "tls;host="})
|
||||
o:depends({type = "ss", v2ray_plugin = "mode=quic;host="})
|
||||
o:depends({type = "ss", plugin = "v2ray-plugin"})
|
||||
|
||||
o = s:option(ListValue, "protocol", translate("Protocol"))
|
||||
for _, v in ipairs(protocol) do
|
||||
|
||||
@ -87,7 +87,7 @@ if Process_list:find("ssr.server") then
|
||||
server_run = 1
|
||||
end
|
||||
|
||||
if Process_list:find("ssrplus/bin/pdnsd") or (Process_list:find("ssrplus.dns") and Process_list:find("dns2socks 127.0.0.1:.*127.0.0.1:5335")) then
|
||||
if Process_list:find("ssrplus/bin/pdnsd") or (Process_list:find("ssrplus.dns") and Process_list:find("dns2socks.127.0.0.1.*127.0.0.1.5335")) then
|
||||
pdnsd_run = 1
|
||||
end
|
||||
|
||||
|
||||
@ -12,17 +12,17 @@
|
||||
var s = document.getElementById(dataname+'-status');
|
||||
if (s)
|
||||
{
|
||||
if(rv.ret=="-1")
|
||||
switch (rv.ret)
|
||||
{
|
||||
s.innerHTML ="<font color='red'>"+"<%:Refresh Error!%> "+"</font>";
|
||||
}
|
||||
if (rv.ret=="0")
|
||||
{
|
||||
s.innerHTML ="<font color='green'>"+"<%:No new data!%> "+"</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
s.innerHTML ="<font color='green'>"+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.ret+"</font>";
|
||||
case 0:
|
||||
s.innerHTML ="<font color='green'>"+"<%:Refresh OK!%> "+"<%:Total Records:%>"+rv.retcount+"</font>";
|
||||
break;
|
||||
case 1:
|
||||
s.innerHTML ="<font color='green'>"+"<%:No new data!%> "+"</font>";
|
||||
break;
|
||||
default:
|
||||
s.innerHTML ="<font color='red'>"+"<%:Refresh Error!%> "+"</font>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
btn.disabled = false;
|
||||
|
||||
@ -1,140 +1,99 @@
|
||||
<%+cbi/valueheader%>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
function padright(str, cnt, pad) {
|
||||
return str + Array(cnt + 1).join(pad);
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
function padright(str, cnt, pad) {
|
||||
return str + Array(cnt + 1).join(pad);
|
||||
}
|
||||
|
||||
function b64EncodeUnicode(str) {
|
||||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
|
||||
return String.fromCharCode('0x' + p1);
|
||||
}));
|
||||
}
|
||||
|
||||
function b64encutf8safe(str) {
|
||||
return b64EncodeUnicode(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '');
|
||||
}
|
||||
|
||||
function b64DecodeUnicode(str) {
|
||||
return decodeURIComponent(Array.prototype.map.call(atob(str), function (c) {
|
||||
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
||||
}).join(''));
|
||||
}
|
||||
|
||||
function b64decutf8safe(str) {
|
||||
var l;
|
||||
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||
l = str.length;
|
||||
l = (4 - l % 4) % 4;
|
||||
if (l) str = padright(str, l, "=");
|
||||
return b64DecodeUnicode(str);
|
||||
}
|
||||
|
||||
function b64encsafe(str) {
|
||||
return btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '')
|
||||
}
|
||||
|
||||
function b64decsafe(str) {
|
||||
var l;
|
||||
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||
l = str.length;
|
||||
l = (4 - l % 4) % 4;
|
||||
if (l) str = padright(str, l, "=");
|
||||
return atob(str);
|
||||
}
|
||||
|
||||
function dictvalue(d, key) {
|
||||
var v = d[key];
|
||||
if (typeof (v) == 'undefined' || v == '') return '';
|
||||
return b64decsafe(v);
|
||||
}
|
||||
|
||||
function export_ssr_url(btn, urlname, sid) {
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s) return false;
|
||||
var v_server = document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0];
|
||||
var v_port = document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0];
|
||||
var v_protocol = document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol')[0];
|
||||
var v_method = document.getElementsByName('cbid.shadowsocksr.' + sid + '.encrypt_method')[0];
|
||||
var v_obfs = document.getElementsByName('cbid.shadowsocksr.' + sid + '.obfs')[0];
|
||||
var v_password = document.getElementsByName('cbid.shadowsocksr.' + sid + '.password')[0];
|
||||
var v_obfs_param = document.getElementsByName('cbid.shadowsocksr.' + sid + '.obfs_param')[0];
|
||||
var v_protocol_param = document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol_param')[0];
|
||||
var v_alias = document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0];
|
||||
var ssr_str = v_server.value + ":" + v_port.value + ":" + v_protocol.value + ":" + v_method.value + ":" + v_obfs.value + ":" + b64encsafe(v_password.value) + "/?obfsparam=" + b64encsafe(v_obfs_param.value) + "&protoparam=" + b64encsafe(v_protocol_param.value) + "&remarks=" + b64encutf8safe(v_alias.value);
|
||||
var textarea = document.createElement("textarea");
|
||||
textarea.textContent = "ssr://" + b64encsafe(ssr_str);
|
||||
textarea.style.position = "fixed";
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
try {
|
||||
document.execCommand("copy"); // Security exception may be thrown by some browsers.
|
||||
s.innerHTML = "<font color='green'><%:Copy SSR to clipboard successfully.%></font>";
|
||||
} catch (ex) {
|
||||
s.innerHTML = "<font color='red'><%:Unable to copy SSR to clipboard.%></font>";
|
||||
} finally {
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
function b64EncodeUnicode(str) {
|
||||
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
|
||||
return String.fromCharCode('0x' + p1);
|
||||
}));
|
||||
}
|
||||
function b64encutf8safe(str) {
|
||||
return b64EncodeUnicode(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '');
|
||||
}
|
||||
function b64DecodeUnicode(str) {
|
||||
return decodeURIComponent(Array.prototype.map.call(atob(str), function (c) {
|
||||
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
|
||||
}).join(''));
|
||||
}
|
||||
function b64decutf8safe(str) {
|
||||
var l;
|
||||
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||
l = str.length;
|
||||
l = (4 - l % 4) % 4;
|
||||
if (l)
|
||||
str = padright(str, l, "=");
|
||||
return b64DecodeUnicode(str);
|
||||
}
|
||||
function b64encsafe(str) {
|
||||
return btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '')
|
||||
}
|
||||
function b64decsafe(str) {
|
||||
var l;
|
||||
str = str.replace(/-/g, "+").replace(/_/g, "/");
|
||||
l = str.length;
|
||||
l = (4 - l % 4) % 4;
|
||||
if (l)
|
||||
str = padright(str, l, "=");
|
||||
return atob(str);
|
||||
}
|
||||
function dictvalue(d, key) {
|
||||
var v = d[key];
|
||||
if (typeof (v) == 'undefined' || v == '')
|
||||
return '';
|
||||
return b64decsafe(v);
|
||||
}
|
||||
function export_ssr_url(btn, urlname, sid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function import_ssr_url(btn, urlname, sid) {
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s)
|
||||
return false;
|
||||
var v_server = document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0];
|
||||
var v_port = document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0];
|
||||
var v_protocol = document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol')[0];
|
||||
var v_method = document.getElementsByName('cbid.shadowsocksr.' + sid + '.encrypt_method')[0];
|
||||
var v_obfs = document.getElementsByName('cbid.shadowsocksr.' + sid + '.obfs')[0];
|
||||
var v_password = document.getElementsByName('cbid.shadowsocksr.' + sid + '.password')[0];
|
||||
var v_obfs_param = document.getElementsByName('cbid.shadowsocksr.' + sid + '.obfs_param')[0];
|
||||
var v_protocol_param = document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol_param')[0];
|
||||
var v_alias = document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0];
|
||||
var ssr_str = v_server.value + ":" +
|
||||
v_port.value + ":" +
|
||||
v_protocol.value + ":" +
|
||||
v_method.value + ":" +
|
||||
v_obfs.value + ":" +
|
||||
b64encsafe(v_password.value) +
|
||||
"/?obfsparam=" + b64encsafe(v_obfs_param.value) +
|
||||
"&protoparam=" + b64encsafe(v_protocol_param.value) +
|
||||
"&remarks=" + b64encutf8safe(v_alias.value);
|
||||
var textarea = document.createElement("textarea");
|
||||
textarea.textContent = "ssr://" + b64encsafe(ssr_str);
|
||||
textarea.style.position = "fixed";
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
try {
|
||||
document.execCommand("copy"); // Security exception may be thrown by some browsers.
|
||||
s.innerHTML = "<font color='green'><%:Copy SSR to clipboard successfully.%></font>";
|
||||
} catch (ex) {
|
||||
s.innerHTML = "<font color='red'><%:Unable to copy SSR to clipboard.%></font>";
|
||||
} finally {
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function import_ssr_url(btn, urlname, sid) {
|
||||
var s = document.getElementById(urlname + '-status');
|
||||
if (!s)
|
||||
return false;
|
||||
var ssrurl = prompt("在这里黏贴配置链接 ssr:// | ss:// | vmess:// | trojan://", "");
|
||||
if (!s) return false;
|
||||
var ssrurl = prompt("<%:Paste sharing link here%>", "");
|
||||
if (ssrurl == null || ssrurl == "") {
|
||||
s.innerHTML = "<font color='red'>用户取消</font>";
|
||||
s.innerHTML = "<font color='red'><%:User cancelled.%></font>";
|
||||
return false;
|
||||
}
|
||||
s.innerHTML = "";
|
||||
//var ssu = ssrurl.match(/ssr:\/\/([A-Za-z0-9_-]+)/i);
|
||||
var ssu = ssrurl.split('://');
|
||||
console.log(ssu.length);
|
||||
if ((ssu[0] != "ssr" && ssu[0] != "ss" && ssu[0] != "vmess" && ssu[0] != "trojan") || ssu[1] == "") {
|
||||
s.innerHTML = "<font color='red'>无效格式</font>";
|
||||
return false;
|
||||
}
|
||||
//console.log(ssu.length);
|
||||
var event = document.createEvent("HTMLEvents");
|
||||
event.initEvent("change", true, true);
|
||||
if (ssu[0] == "ssr") {
|
||||
var sstr = b64decsafe(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "ssr";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
param = sstr.substr(ploc + 2);
|
||||
}
|
||||
var ssm = url0.match(/^(.+):([^:]+):([^:]*):([^:]+):([^:]*):([^:]+)/);
|
||||
if (!ssm || ssm.length < 7)
|
||||
return false;
|
||||
var pdict = {};
|
||||
if (param.length > 2)
|
||||
{
|
||||
var a = param.split('&');
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
var b = a[i].split('=');
|
||||
pdict[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0].value = ssm[1];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = ssm[2];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol')[0].value = ssm[3];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.encrypt_method')[0].value = ssm[4];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.obfs')[0].value = ssm[5];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.password')[0].value = b64decsafe(ssm[6]);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.obfs_param')[0].value = dictvalue(pdict, 'obfsparam');
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol_param')[0].value = dictvalue(pdict, 'protoparam');
|
||||
var rem = pdict['remarks'];
|
||||
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0)
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = b64decutf8safe(rem);
|
||||
s.innerHTML = "<font color='green'>导入ShadowsocksR配置信息成功</font>";
|
||||
return false;
|
||||
} else if (ssu[0] == "ss") {
|
||||
switch (ssu[0]) {
|
||||
case "ss":
|
||||
var url0, param = "";
|
||||
var sipIndex = ssu[1].indexOf("@");
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
@ -156,7 +115,7 @@
|
||||
var pluginInfo = decodeURIComponent(temp[1]);
|
||||
var pluginIndex = pluginInfo.indexOf(";");
|
||||
var pluginNameInfo = pluginInfo.substr(0, pluginIndex);
|
||||
plugin = pluginNameInfo.substr(pluginNameInfo.indexOf("=") + 1)
|
||||
plugin = pluginNameInfo.substr(pluginNameInfo.indexOf("=") + 1);
|
||||
pluginOpts = pluginInfo.substr(pluginIndex + 1);
|
||||
}
|
||||
var userInfoSplitIndex = userInfo.indexOf(":");
|
||||
@ -170,12 +129,13 @@
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = port;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.password')[0].value = password || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.encrypt_method_ss')[0].value = method || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin')[0].value = plugin || "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin')[0].value = plugin || "none";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin_opts')[0].value = pluginOpts || "";
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font color='green'>导入Shadowsocks配置信息成功</font>";
|
||||
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
} else {
|
||||
var sstr = b64decsafe(url0);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "ss";
|
||||
@ -188,15 +148,45 @@
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = part2[1];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.password')[0].value = part1[1];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.encrypt_method_ss')[0].value = part1[0];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin')[0].value = "";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.plugin_opts')[0].value = "";
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font color='green'>导入Shadowsocks配置信息成功</font>";
|
||||
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
}
|
||||
return false;
|
||||
} else if (ssu[0] == "trojan") {
|
||||
case "ssr":
|
||||
var sstr = b64decsafe(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "ssr";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var url0, param = "";
|
||||
if (ploc > 0) {
|
||||
url0 = sstr.substr(0, ploc);
|
||||
param = sstr.substr(ploc + 2);
|
||||
}
|
||||
var ssm = url0.match(/^(.+):([^:]+):([^:]*):([^:]+):([^:]*):([^:]+)/);
|
||||
if (!ssm || ssm.length < 7) return false;
|
||||
var pdict = {};
|
||||
if (param.length > 2) {
|
||||
var a = param.split('&');
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
var b = a[i].split('=');
|
||||
pdict[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0].value = ssm[1];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = ssm[2];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol')[0].value = ssm[3];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.encrypt_method')[0].value = ssm[4];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.obfs')[0].value = ssm[5];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.password')[0].value = b64decsafe(ssm[6]);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.obfs_param')[0].value = dictvalue(pdict, 'obfsparam');
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.protocol_param')[0].value = dictvalue(pdict, 'protoparam');
|
||||
var rem = pdict['remarks'];
|
||||
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0) document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = b64decutf8safe(rem);
|
||||
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
case "trojan":
|
||||
var url0, param = "";
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
if (ploc > 0) {
|
||||
@ -214,9 +204,9 @@
|
||||
var others = serverPart[1].split('?');
|
||||
var port = others[0]
|
||||
var queryParam = {}
|
||||
if(others.length > 1) {
|
||||
if (others.length > 1) {
|
||||
var queryParams = others[1]
|
||||
var queryArray = queryParams.split('&')
|
||||
var queryArray = queryParams.split('&');
|
||||
for (i = 0; i < queryArray.length; i++) {
|
||||
var params = queryArray[i].split('=');
|
||||
queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || '');
|
||||
@ -229,13 +219,12 @@
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = queryParam.peer || '';
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.insecure')[0].checked = queryParam.allowInsecure === '1';
|
||||
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font color='green'>导入Trojan配置信息成功</font>";
|
||||
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
} else if (ssu[0] == "vmess") {
|
||||
case "vmess":
|
||||
var sstr = b64DecodeUnicode(ssu[1]);
|
||||
var ploc = sstr.indexOf("/?");
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "vmess";
|
||||
@ -250,42 +239,119 @@
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0].value = ssm.add;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = ssm.port;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alter_id')[0].value = ssm.aid;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.vmess_id')[0].value = ssm.id;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.uuid')[0].value = ssm.id;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value = ssm.net;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].dispatchEvent(event);
|
||||
if (ssm.net == "tcp") {
|
||||
if (ssm.type && ssm.type != "http") {ssm.type = "none"}
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tcp_guise')[0].value = ssm.type;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_path')[0].value = ssm.path;
|
||||
if (ssm.type && ssm.type != "http") {
|
||||
ssm.type = "none"
|
||||
}
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tcp_guise')[0].value = ssm.type;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.http_path')[0].value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "ws") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_path')[0].value = ssm.path;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_path')[0].value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "h2") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_path')[0].value = ssm.path;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_path')[0].value = ssm.path;
|
||||
}
|
||||
if (ssm.net == "quic") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_security')[0].value = ssm.securty;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_key')[0].value = ssm.key;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_security')[0].value = ssm.securty;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_key')[0].value = ssm.key;
|
||||
}
|
||||
if (ssm.net == "kcp") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.kcp_guise')[0].value = ssm.type;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.kcp_guise')[0].value = ssm.type;
|
||||
}
|
||||
if (ssm.tls == "tls") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].checked = true;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = ssm.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].checked = true;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = ssm.host;
|
||||
}
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].checked = true;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.mux')[0].dispatchEvent(event);
|
||||
s.innerHTML = "<font color='green'>导入V2ray配置信息成功</font>";
|
||||
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
case "vless":
|
||||
var url0, param = "";
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
if (ploc > 0) {
|
||||
url0 = ssu[1].substr(0, ploc);
|
||||
param = decodeURIComponent(ssu[1].substr(ploc + 1));
|
||||
} else {
|
||||
url0 = ssu[1]
|
||||
}
|
||||
var sstr = url0;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].value = "vless";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.type')[0].dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
var uuid = team[0]
|
||||
var serverPart = team[1].split(':');
|
||||
var others = serverPart[1].split('?');
|
||||
var port = others[0]
|
||||
var queryParam = {}
|
||||
if (others.length > 1) {
|
||||
var queryParams = others[1]
|
||||
var queryArray = queryParams.split('&');
|
||||
for (i = 0; i < queryArray.length; i++) {
|
||||
var params = queryArray[i].split('=');
|
||||
queryParam[decodeURIComponent(params[0])] = decodeURIComponent(params[1] || '');
|
||||
}
|
||||
}
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server')[0].value = serverPart[0];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.server_port')[0].value = port;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.vmess_id')[0].value = uuid;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].value = queryParam.type || "tcp";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.transport')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.vless_encryption')[0].value = queryParam.encryption || "none";
|
||||
if (queryParam.security == "tls") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].checked = true;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = queryParam.sni || serverPart[0];
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls')[0].dispatchEvent(event);
|
||||
}
|
||||
switch (queryParam.type) {
|
||||
case "ws":
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_host')[0].value = queryParam.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.ws_path')[0].value = queryParam.path;
|
||||
break;
|
||||
case "kcp":
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.kcp_guise')[0].value = queryParam.headerType || "none";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.kcp_guise')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.seed')[0].value = queryParam.seed;
|
||||
break;
|
||||
case "http":
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_host')[0].value = queryParam.host;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.h2_path')[0].value = queryParam.path;
|
||||
break;
|
||||
case "quic":
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_guise')[0].value = queryParam.headerType || "none";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_guise')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_security')[0].value = queryParam.quicSecurity;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.quic_key')[0].value = queryParam.key;
|
||||
break;
|
||||
default:
|
||||
if (queryParam.security == "xtls") {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.xtls')[0].checked = true;
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.xtls')[0].dispatchEvent(event);
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.vless_flow')[0].value = queryParam.flow || "xtls-rprx-splice";
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.tls_host')[0].value = queryParam.sni || serverPart[0];
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (param != undefined) {
|
||||
document.getElementsByName('cbid.shadowsocksr.' + sid + '.alias')[0].value = decodeURI(param);
|
||||
}
|
||||
s.innerHTML = "<font color='green'><%:Import configuration information successfully.%></font>";
|
||||
return false;
|
||||
default:
|
||||
s.innerHTML = "<font color='red'><%:Invalid format.%></font>";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//]]></script>
|
||||
<input type="button" class="cbi-button cbi-button-apply" value="导入配置信息" onclick="return import_ssr_url(this, '<%=self.option%>', '<%=self.value%>')" />
|
||||
//]]>
|
||||
</script>
|
||||
<input type="button" class="cbi-button cbi-button-apply" value="<%:Import%>" onclick="return import_ssr_url(this, '<%=self.option%>', '<%=self.value%>')" />
|
||||
<span id="<%=self.option%>-status"></span>
|
||||
<%+cbi/valuefooter%>
|
||||
|
||||
@ -382,23 +382,23 @@ msgstr "DNS 防污染服务"
|
||||
msgid "Use Other DNS Tunnel(Need to install)"
|
||||
msgstr "使用其他DNS转发(需要自己安装)"
|
||||
|
||||
msgid "Import SSR"
|
||||
msgstr "导入ssr配置信息"
|
||||
msgid "Import"
|
||||
msgstr "导入配置信息"
|
||||
|
||||
msgid "Export SSR"
|
||||
msgstr "导出ssr配置信息"
|
||||
|
||||
msgid "Import SSR successfully."
|
||||
msgstr "成功导入SSR。"
|
||||
msgid "Import configuration information successfully."
|
||||
msgstr "导入配置信息成功。"
|
||||
|
||||
msgid "Invalid SSR format."
|
||||
msgstr "无效的SSR格式。"
|
||||
msgid "Invalid format."
|
||||
msgstr "无效的格式。"
|
||||
|
||||
msgid "User cancelled."
|
||||
msgstr "用户已取消。"
|
||||
|
||||
msgid "Paste ssr url here"
|
||||
msgstr "在此处粘贴ssr://网址"
|
||||
msgid "Paste sharing link here"
|
||||
msgstr "在此处粘贴分享链接"
|
||||
|
||||
msgid "Unable to copy SSR to clipboard."
|
||||
msgstr "无法复制SSR网址到剪贴板。"
|
||||
@ -691,9 +691,6 @@ msgstr "混淆密码(可选)"
|
||||
msgid "Select the interface that needs to transmit data. If unchecked, all interfaces will pass data by default!"
|
||||
msgstr "选择需要传递数据的接口。如果未选择,则默认情况下所有接口都将传递数据!"
|
||||
|
||||
msgid "Please fill in the Host, for example: www.baidu.com"
|
||||
msgstr "请填写Host,例如:www.baidu.com"
|
||||
|
||||
msgid "Camouflage Type"
|
||||
msgstr "伪装类型"
|
||||
|
||||
|
||||
@ -75,13 +75,13 @@ get_host_ip() {
|
||||
local host=$(uci_get_by_name $1 server)
|
||||
local ip=$host
|
||||
if [ -z "$(echo $host | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}")" ]; then
|
||||
if [ "$host" == "${host1#*:[0-9a-fA-F]}" ]; then
|
||||
if [ "$host" == "${host#*:[0-9a-fA-F]}" ]; then
|
||||
ip=$(resolveip -4 -t 3 $host | awk 'NR==1{print}')
|
||||
[ -z "$ip" ] && ip=$(wget -q -O- http://119.29.29.29/d?dn=$host | awk -F ';' '{print $1}')
|
||||
fi
|
||||
fi
|
||||
[ -z "$ip" ] || uci_set_by_name $1 ip $ip
|
||||
echo ${ip:="$(uci_get_by_name $1 ip "ERROR")"}
|
||||
[ "$ip" == "ERROR" ] || uci_set_by_name $1 ip $hostip
|
||||
}
|
||||
|
||||
clean_log() {
|
||||
@ -343,9 +343,9 @@ start_udp() {
|
||||
;;
|
||||
trojan) #client
|
||||
gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_local_port
|
||||
ln_start_bin $(first_type $type) $type --config $udp_config_file
|
||||
ln_start_bin $(first_type ${type}-go ${type}) $type --config $udp_config_file
|
||||
ln_start_bin $(first_type ipt2socks) ipt2socks -U -b 0.0.0.0 -4 -s 127.0.0.1 -p $tmp_udp_local_port -l $tmp_udp_port
|
||||
echolog "UDP TPROXY Relay:$($(first_type $type) --version 2>&1 | head -1) Started!"
|
||||
echolog "UDP TPROXY Relay:$($(first_type ${type}-go ${type}) --version 2>&1 | head -1) Started!"
|
||||
;;
|
||||
naiveproxy)
|
||||
echolog "NaïveProxy UDP TPROXY Relay not supported!"
|
||||
@ -394,15 +394,15 @@ start_shunt() {
|
||||
;;
|
||||
trojan)
|
||||
gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port
|
||||
ln_start_bin $(first_type ${type}) $type --config $shunt_config_file
|
||||
ln_start_bin $(first_type ${type}-go ${type}) $type --config $shunt_config_file
|
||||
if [ -n "$tmp_local_port" ]; then
|
||||
local tmp_port=$tmp_local_port
|
||||
else
|
||||
local tmp_port=$tmp_shunt_local_port
|
||||
ln_start_bin $(first_type ${type}) $type --config $shunt_dns_config_file
|
||||
ln_start_bin $(first_type ${type}-go ${type}) $type --config $shunt_dns_config_file
|
||||
fi
|
||||
ln_start_bin $(first_type dns2socks) dns2socks 127.0.0.1:$tmp_port 8.8.8.8:53 127.0.0.1:$tmp_shunt_dns_port -q
|
||||
echolog "shunt:$($(first_type $type) --version 2>&1 | head -1) Started!"
|
||||
echolog "shunt:$($(first_type ${type}-go ${type}) --version 2>&1 | head -1) Started!"
|
||||
;;
|
||||
naiveproxy)
|
||||
gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port
|
||||
@ -452,8 +452,8 @@ start_local() {
|
||||
;;
|
||||
trojan) #client
|
||||
gen_config_file $LOCAL_SERVER $type 4 $local_port
|
||||
ln_start_bin $(first_type $type) $type --config $local_config_file
|
||||
echolog "Global_Socks5:$($(first_type $type) --version 2>&1 | head -1) Started!"
|
||||
ln_start_bin $(first_type ${type}-go ${type}) $type --config $local_config_file
|
||||
echolog "Global_Socks5:$($(first_type ${type}-go ${type}) --version 2>&1 | head -1) Started!"
|
||||
;;
|
||||
naiveproxy)
|
||||
gen_config_file $LOCAL_SERVER $type 4 $local_port
|
||||
@ -512,10 +512,8 @@ Start_Run() {
|
||||
;;
|
||||
trojan)
|
||||
gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
|
||||
for i in $(seq 1 $threads); do
|
||||
ln_start_bin $(first_type $type) $type --config $tcp_config_file
|
||||
done
|
||||
echolog "Main node:$($(first_type $type) --version 2>&1 | head -1) , $threads Threads Started!"
|
||||
ln_start_bin $(first_type ${type}-go ${type}) $type --config $tcp_config_file
|
||||
echolog "Main node:$($(first_type $type) --version 2>&1 | head -1) Started!"
|
||||
;;
|
||||
naiveproxy)
|
||||
gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
|
||||
@ -716,7 +714,7 @@ start_rules() {
|
||||
local local_port=$(uci_get_by_name $GLOBAL_SERVER local_port)
|
||||
local lan_ac_ips=$(uci_get_by_type access_control lan_ac_ips)
|
||||
local lan_ac_mode=$(uci_get_by_type access_control lan_ac_mode)
|
||||
if [ "$kcp_enable_flag" == "0" ]; then
|
||||
if [ "$kcp_enable_flag" == "0" -a "$redir_udp" == "1" ]; then
|
||||
local udp_server=$(get_host_ip $UDP_RELAY_SERVER)
|
||||
local udp_local_port=$tmp_udp_port
|
||||
fi
|
||||
|
||||
@ -4111,6 +4111,7 @@
|
||||
103.160.34.0/23
|
||||
103.160.112.0/23
|
||||
103.160.114.0/23
|
||||
103.160.244.0/23
|
||||
103.192.0.0/22
|
||||
103.192.4.0/22
|
||||
103.192.8.0/22
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -39,7 +39,7 @@ set shadowsocksr.@global[0].enable_switch='1'
|
||||
set shadowsocksr.@global[0].switch_time='667'
|
||||
set shadowsocksr.@global[0].switch_timeout='5'
|
||||
set shadowsocksr.@global[0].switch_try_count='3'
|
||||
set shadowsocksr.@global[0].gfwlist_url='https://cdn.jsdelivr.net/gh/v2fly/domain-list-community@release/gfwlist.txt'
|
||||
set shadowsocksr.@global[0].gfwlist_url='https://cdn.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt'
|
||||
set shadowsocksr.@global[0].chnroute_url='https://ispip.clang.cn/all_cn.txt'
|
||||
set shadowsocksr.@global[0].nfip_url='https://cdn.jsdelivr.net/gh/QiuSimons/Netflix_IP/getflix.txt'
|
||||
set shadowsocksr.@global[0].adblock_url='https://neodev.team/lite_host_dnsmasq.conf'
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
local ucursor = require"luci.model.uci".cursor()
|
||||
local ucursor = require "luci.model.uci".cursor()
|
||||
local json = require "luci.jsonc"
|
||||
local server_section = arg[1]
|
||||
local proto = arg[2]
|
||||
@ -141,21 +141,22 @@ local ss = {
|
||||
local_address = "0.0.0.0",
|
||||
local_port = tonumber(local_port),
|
||||
password = server.password,
|
||||
method = server.encrypt_method,
|
||||
timeout = tonumber(server.timeout) or 60,
|
||||
method = server.encrypt_method_ss,
|
||||
timeout = tonumber(server.timeout),
|
||||
fast_open = (server.fast_open == "1") and true or false,
|
||||
reuse_port = true
|
||||
}
|
||||
if server.type == "ss" then
|
||||
if server.plugin then
|
||||
if server.plugin and server.plugin ~= "none" then
|
||||
ss.plugin = server.plugin
|
||||
ss.plugin_opts = (server.simple_obfs) and server.simple_obfs .. server.plugin_opts or (server.v2ray_plugin ~= "none") and server.v2ray_plugin .. server.plugin_opts or nil
|
||||
ss.plugin_opts = server.plugin_opts or nil
|
||||
end
|
||||
print(json.stringify(ss, 1))
|
||||
end
|
||||
if server.type == "ssr" then
|
||||
ss.protocol = server.protocol
|
||||
ss.protocol_param = server.protocol_param
|
||||
ss.method = server.encrypt_method
|
||||
ss.obfs = server.obfs
|
||||
ss.obfs_param = server.obfs_param
|
||||
print(json.stringify(ss, 1))
|
||||
|
||||
@ -257,6 +257,72 @@ local function processData(szType, content)
|
||||
result.server_port = host[2]
|
||||
end
|
||||
result.password = password
|
||||
elseif szType == "vless" then
|
||||
local idx_sp = 0
|
||||
local alias = ""
|
||||
if content:find("#") then
|
||||
idx_sp = content:find("#")
|
||||
alias = content:sub(idx_sp + 1, -1)
|
||||
end
|
||||
local info = content:sub(1, idx_sp - 1)
|
||||
local hostInfo = split(info, "@")
|
||||
local host = split(hostInfo[2], ":")
|
||||
local uuid = hostInfo[1]
|
||||
if host[2]:find("?") then
|
||||
local query = split(host[2], "?")
|
||||
local params = {}
|
||||
for _, v in pairs(split(UrlDecode(query[2]), '&')) do
|
||||
local t = split(v, '=')
|
||||
params[t[1]] = t[2]
|
||||
end
|
||||
result.alias = UrlDecode(alias)
|
||||
result.type = "vless"
|
||||
result.server = host[1]
|
||||
result.server_port = query[1]
|
||||
result.vmess_id = uuid
|
||||
result.vless_encryption = params.encryption or "none"
|
||||
result.transport = params.type or "tcp"
|
||||
if not params.type or params.type == "tcp" then
|
||||
if params.security == "xtls" then
|
||||
result.xtls = "1"
|
||||
result.tls_host = params.sni or host[1]
|
||||
result.vless_flow = params.flow
|
||||
else
|
||||
result.xtls = "0"
|
||||
end
|
||||
end
|
||||
if params.type == 'ws' then
|
||||
result.ws_host = params.host
|
||||
result.ws_path = params.path or "/"
|
||||
end
|
||||
if params.type == 'http' then
|
||||
result.h2_host = params.host or host[1]
|
||||
result.h2_path = params.path or "/"
|
||||
end
|
||||
if params.type == 'kcp' then
|
||||
result.kcp_guise = params.headerType or "none"
|
||||
result.mtu = 1350
|
||||
result.tti = 50
|
||||
result.uplink_capacity = 5
|
||||
result.downlink_capacity = 20
|
||||
result.read_buffer_size = 2
|
||||
result.write_buffer_size = 2
|
||||
result.seed = params.seed
|
||||
end
|
||||
if params.type == 'quic' then
|
||||
result.quic_guise = params.headerType or "none"
|
||||
result.quic_key = params.key
|
||||
result.quic_security = params.quicSecurity or "none"
|
||||
end
|
||||
if params.security == "tls" then
|
||||
result.tls = "1"
|
||||
result.tls_host = params.sni or host[1]
|
||||
else
|
||||
result.tls = "0"
|
||||
end
|
||||
else
|
||||
result.server_port = host[2]
|
||||
end
|
||||
end
|
||||
if not result.alias then
|
||||
if result.server and result.server_port then
|
||||
|
||||
@ -93,7 +93,7 @@ end
|
||||
|
||||
local log = function(...)
|
||||
if args then
|
||||
print(...)
|
||||
print("{ret=" .. table.concat({...}, ",retcount=") .. "}")
|
||||
else
|
||||
print(os.date("%Y-%m-%d %H:%M:%S ") .. table.concat({...}, " "))
|
||||
end
|
||||
@ -136,7 +136,7 @@ local function update(url, file, type, file2)
|
||||
local old_md5 = luci.sys.exec("echo -n $([ -f '" .. file .. "' ] && md5sum " .. file .. " | awk '{print $1}')")
|
||||
if new_md5 == old_md5 then
|
||||
if args then
|
||||
log("0")
|
||||
log(1)
|
||||
else
|
||||
log("你已经是最新数据,无需更新!")
|
||||
end
|
||||
@ -152,14 +152,14 @@ local function update(url, file, type, file2)
|
||||
luci.sys.call("/usr/share/shadowsocksr/chinaipset.sh " .. TMP_PATH .. "/china_ssr.txt")
|
||||
end
|
||||
if args then
|
||||
log(tonumber(icount) / Num)
|
||||
log(0, tonumber(icount) / Num)
|
||||
else
|
||||
log("更新成功! 新的总纪录数:" .. tostring(tonumber(icount) / Num))
|
||||
end
|
||||
end
|
||||
else
|
||||
if args then
|
||||
log("-1")
|
||||
log(-1)
|
||||
else
|
||||
log("更新失败!")
|
||||
end
|
||||
|
||||
@ -37,6 +37,7 @@ include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
DEPENDS:=$$(GO_ARCH_DEPENDS)
|
||||
TITLE:=An unidentifiable mechanism that helps you bypass GFW. It's compatible with original trojan with experimental features.
|
||||
URL:=https://github.com/p4gefau1t/trojan-go
|
||||
|
||||
Loading…
Reference in New Issue
Block a user