luci-app-ssr-plus: sync with upstream source

This commit is contained in:
CN_SZTL 2020-10-04 21:06:02 +08:00
parent 6fec104ca5
commit 9d9fe3d421
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
4 changed files with 22 additions and 4 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=180
PKG_RELEASE:=7
PKG_RELEASE:=8
include $(INCLUDE_DIR)/package.mk

View File

@ -398,6 +398,12 @@ o = s:option(Value, "tls_host", translate("TLS Host"))
o:depends("tls", "1")
o.rmempty = true
-- XTLS
o = s:option(Flag, "xtls", translate("XTLS"))
o.rmempty = true
o.default = "0"
o:depends({type="vless", tls="1"})
-- [[ Mux ]]--
o = s:option(Flag, "mux", translate("Mux"))
o.rmempty = true

View File

@ -371,7 +371,7 @@ start_redir_tcp() {
;;
naiveproxy)
$bin /var/etc/naive-ssr-retcp.json >/dev/null 2>&1 &
echo "$(date "+%Y-%m-%d %H:%M:%S") Main node:$($bin --version 2>&1 | head -1) Started!" >>/tmp/ssrplus.log
echo "$(date "+%Y-%m-%d %H:%M:%S") Main node:$($bin --version 2>&1 | head -1) , $threads Threads Started!" >>/tmp/ssrplus.log
;;
socks5)
/usr/share/shadowsocksr/genred2config.sh "/var/etc/redsocks-ssr-retcp.conf" socks5 tcp $(uci_get_by_name $GLOBAL_SERVER local_port) \

View File

@ -5,6 +5,16 @@ local proto = arg[2]
local local_port = arg[3] or "0"
local socks_port = arg[4] or "0"
local server = ucursor:get_all("shadowsocksr", server_section)
local outbound_security = "none"
if (server.xtls == '1')
then
outbound_security = "xtls"
elseif (server.tls == '1')
then
outbound_security = "tls"
end
local vless = {
log = {
-- error = "/var/ssrplus.log",
@ -45,6 +55,7 @@ outbound = {
users = {
{
id = server.vmess_id,
flow = (server.xtls == '1') and "xtls-rprx-origin" or nil,
encryption = server.vless_encryption
}
}
@ -54,8 +65,9 @@ outbound = {
-- 底层传输配置
streamSettings = {
network = server.transport,
security = (server.tls == '1') and "tls" or "none",
tlsSettings = {allowInsecure = (server.insecure ~= "0") and true or false,serverName=server.tls_host,},
security = outbound_security,
tlsSettings = (outbound_security == "tls") and {allowInsecure = (server.insecure ~= "0") and true or false,serverName=server.tls_host,} or nil,
xtlsSettings = (outbound_security == "xtls") and {allowInsecure = (server.insecure ~= "0") and true or false,serverName=server.tls_host,} or nil,
tcpSettings = (server.transport == "tcp") and {
header = {
type = server.tcp_guise,