Просмотр исходного кода

tuic-client options are complished

TeF 2 лет назад
Родитель
Сommit
bd1d6bb82e

+ 29 - 13
luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua

@@ -225,7 +225,6 @@ o:depends({type = "v2ray", v2ray_protocol = "socks"})
 o = s:option(Value, "username", translate("Username"))
 o.rmempty = true
 o:depends("type", "naiveproxy")
---o:depends("type", "tuic")
 o:depends({type = "socks5", auth_enable = true})
 o:depends({type = "v2ray", v2ray_protocol = "http", auth_enable = true})
 o:depends({type = "v2ray", v2ray_protocol = "socks", auth_enable = true})
@@ -237,7 +236,6 @@ o:depends("type", "ssr")
 o:depends("type", "ss")
 o:depends("type", "trojan")
 o:depends("type", "naiveproxy")
-o:depends("type", "tuic")
 o:depends({type = "socks5", auth_enable = true})
 o:depends({type = "v2ray", v2ray_protocol = "http", auth_enable = true})
 o:depends({type = "v2ray", v2ray_protocol = "socks", socks_ver = "5", auth_enable = true})
@@ -356,6 +354,13 @@ o.rmempty = true
 o.default = uuid
 o:depends("type", "tuic")
 
+--Tuic IP
+o = s:option(Value, "tuic_ip", translate("TUIC Server IP Address"))
+o.rmempty = true
+o.datatype = "ip4addr"
+o.default = ""
+o:depends("type", "tuic")
+
 -- Tuic Password
 o = s:option(Value, "tuic_passwd", translate("TUIC User Password"))
 o.rmempty = true
@@ -365,8 +370,8 @@ o:depends("type", "tuic")
 
 o = s:option(ListValue, "udp_relay_mode", translate("UDP relay mode"))
 o:depends("type", "tuic")
-o:value("native", translate("native"))
-o:value("quic", translate("QUIC"))
+o:value("native", translate("native UDP characteristics")
+o:value("quic", translate("lossless UDP relay using QUIC streams")
 o.default = "native"
 o.rmempty = true
 
@@ -384,35 +389,34 @@ o.datatype = "uinteger"
 o.default = "3"
 o.rmempty = true
 
-o = s:option(Value, "timeout", translate("timeout for establishing a connection to server(second)"))
+o = s:option(Value, "timeout", translate("Timeout for establishing a connection to server(second)"))
 o:depends("type", "tuic")
 o.datatype = "uinteger"
 o.default = "8"
 o.rmempty = true
 
-o = s:option(Value, "gc_interval", translate("garbage collection interval(second)"))
+o = s:option(Value, "gc_interval", translate("Garbage collection interval(second)"))
 o:depends("type", "tuic")
 o.datatype = "uinteger"
 o.default = "3"
 o.rmempty = true
 
-o = s:option(Value, "gc_lifetime", translate("garbage collection lifetime(second)"))
+o = s:option(Value, "gc_lifetime", translate("Garbage collection lifetime(second)"))
 o:depends("type", "tuic")
 o.datatype = "uinteger"
 o.default = "15"
 o.rmempty = true
 
-
 o = s:option(Value, "send_window", translate("TUIC send window"))
-o.datatype = "uinteger"
 o:depends("type", "tuic")
-o.default = 20971520
+o.datatype = "uinteger"
+o.default = 16777216
 o.rmempty = true
 
 o = s:option(Value, "receive_window", translate("TUIC receive window"))
-o.datatype = "uinteger"
 o:depends("type", "tuic")
-o.default = 10485760
+o.datatype = "uinteger"
+o.default = 8388608
 o.rmempty = true
 
 o = s:option(Flag, "disable_sni", translate("Disable SNI"))
@@ -425,6 +429,18 @@ o:depends("type", "tuic")
 o.default = 0
 o.rmempty = true
 
+--Tuic settings for the local inbound socks5 server
+o = s:option(Flag, "tuic_dual_stack", translate("Set if the listening socket should be dual-stack"))
+o:depends("type", "tuic")
+o.default = 0
+o.rmempty = true
+
+o = s:option(Value, "tuic_max_package_size", translate("Maximum packet size the socks5 server can receive from external"))
+o:depends("type", "tuic")
+o.datatype = "uinteger"
+o.default = 1500
+o.rmempty = true
+
 -- VmessId
 o = s:option(Value, "vmess_id", translate("Vmess/VLESS ID (UUID)"))
 o.rmempty = true
@@ -874,4 +890,4 @@ if is_finded("kcptun-client") then
 	o:depends("type", "ss")
 end
 
-return m
+return m

+ 18 - 10
luci-app-ssr-plus/po/zh-cn/ssr-plus.po

@@ -853,10 +853,13 @@ msgstr "应用"
 msgid "Enable Netflix Mode"
 msgstr "启用 Netflix 分流模式"
 
-msgid "TUIC user UUID"
+msgid "TUIC User UUID"
 msgstr "TUIC用户uuid"
 
-msgid "TUIC user Password"
+msgid "TUIC Server IP Address"
+msgstr "TUIC 服务器IP地址"
+
+msgid "TUIC User Password"
 msgstr "TUIC用户密钥"
 
 msgid "UDP relay mode"
@@ -865,23 +868,23 @@ msgstr "UDP中继模式"
 msgid "native UDP characteristics"
 msgstr "原生UDP特性"
 
-msgid "lossless UDP relay using QUIC streams, additional overhead is introduced"
-msgstr "使用 QUIC 流的无损 UDP 中继(引入了额外的开销)"
+msgid "lossless UDP relay using QUIC streams"
+msgstr "使用 QUIC 流的无损 UDP 中继"
 
 msgid "Congestion control algorithm"
 msgstr "拥塞控制算法"
 
 msgid "Heartbeat interval(second)"
-msgstr "设置连接保活间隔(单位:秒)"
+msgstr "保活心跳包发送间隔(单位:秒)"
 
 msgid "Timeout for establishing a connection to server(second)"
-msgstr "设置建立连接超时(单位:秒)"
+msgstr "连接超时时间(单位:秒)"
 
 msgid "Garbage collection interval(second)"
-msgstr "设置UDP碎片收集时间间隔(单位:秒)"
+msgstr "UDP数据包片残片清理间隔(单位:秒)"
 
 msgid "Garbage collection lifetime(second)"
-msgstr "设置UDP碎片生存时间(单位:秒)"
+msgstr "UDP数据包残片在服务器的保留时间(单位:秒)"
 
 msgid "Disable SNI"
 msgstr "关闭SNI服务器名称指示"
@@ -890,8 +893,13 @@ msgid "Enable 0-RTT QUIC handshake"
 msgstr "客户端启用 0-RTT QUIC 连接握手"
 
 msgid "TUIC send window"
-msgstr "发送窗口(无需确认即可发送的最大字节数)"
+msgstr "发送窗口(无需确认即可发送的最大字节数:默认8Mb*2)"
 
 msgid "TUIC receive window"
-msgstr "接收窗口(无需确认即可接收的最大字节数)"
+msgstr "接收窗口(无需确认即可接收的最大字节数:默认8Mb)"
+
+msgid "Set if the listening socket should be dual-stack"
+msgstr "设置监听套接字为双栈"
 
+msgid "Maximum packet size the socks5 server can receive from external"
+msgstr "socks5服务器可以从外部接收的最大数据包大小(单位:字节)"

+ 22 - 20
luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua

@@ -306,27 +306,29 @@ local hysteria = {
 	lazy_start = (server.lazy_start == "1") and true or false
 }
 local tuic = {
-        relay = {
-                server = server.server .. ":" .. server.server_port,
-                uuid = server.tuic_uuid,
-                password = server.tuic_passwd,
-                certificates = server.certificate and { server.certpath } or nil,
-                udp_relay_mode = server.udp_relay_mode,
-                congestion_control = server.congestion_control,
-                heartbeat = server.heartbeat .. "s",
-                timeout = server.timeout .. "s",
-                gc_interval = server.gc_interval .. "s",
-                gc_lifetime = server.gc_lifetime .. "s",
-                alpn = server.tls_alpn,
-                disable_sni = (server.disable_sni == "1"),
-                zero_rtt_handshake = (server.zero_rtt_handshake == "1"),
-                send_window = tonumber(server.send_window),
-                receive_window = tonumber(server.receive_window),
-                max_udp_relay_packet_size = tonumber(server.max_udp_relay_packet_size)
+		relay = {
+				server = server.server .. ":" .. server.server_port,
+				ip = server.tuic_ip,
+				uuid = server.tuic_uuid,
+				password = server.tuic_passwd,
+				certificates = server.certificate and { server.certpath } or nil,
+				udp_relay_mode = server.udp_relay_mode,
+				congestion_control = server.congestion_control,
+				heartbeat = server.heartbeat .. "s",
+				timeout = server.timeout .. "s",
+				gc_interval = server.gc_interval .. "s",
+				gc_lifetime = server.gc_lifetime .. "s",
+				alpn = server.tls_alpn,
+				disable_sni = (server.disable_sni == "1"),
+				zero_rtt_handshake = (server.zero_rtt_handshake == "1"),
+				send_window = tonumber(server.send_window),
+				receive_window = tonumber(server.receive_window)
         },
-        ["local"] = {
-                server = "0.0.0.0:" .. tonumber(local_port)
-        }
+		["local"] = {
+				server = "[::]:" .. tonumber(local_port),
+				dual_stack = dual_stack = (server.tuic_dual_stack == "1") and true or false,
+				max_packet_size = server.tuic_max_package_size
+		}
 }
 local config = {}
 function config:new(o)