Skip to content

Commit

Permalink
fix hysteria minor errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AmberisMyShiba committed Oct 9, 2023
1 parent 7b32657 commit 06cf02e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 16 deletions.
20 changes: 14 additions & 6 deletions luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ o = s:option(Value, "hy2_auth", translate("Users Authentication"))
o:depends("type", "hysteria")
o.rmempty = false

o = s:option(ListValue, "hysteria_protocol", translate("Protocol"))
o = s:option(ListValue, "transport_protocol", translate("Protocol"))
o:depends("type", "hysteria")
o:value("udp", translate("udp"))
o.default = "udp"
Expand All @@ -339,6 +339,12 @@ o:depends("type", "hysteria")
o.rmempty = true
o.default = "0"

o = s:option(Value, "hopinterval", translate("Port Hopping Interval(Unit:Second)"))
o:depends({type = "hysteria", port_hopping = 1})
o.datatype = "uinteger"
o.rmempty = true
o.default = "30"

o = s:option(Value, "port_range", translate("Port Range"))
o:depends({type = "hysteria", port_hopping = 1})
o.rmempty = false
Expand Down Expand Up @@ -396,12 +402,14 @@ o.default = "20971520"
o = s:option(Value, "maxidletimeout", translate("QUIC maxIdleTimeout(Unit:second)"))
o:depends({type = "hysteria",flag_quicparam = "1"})
o.rmempty = true
o.default = "30s"
o.datatype = "uinteger"
o.default = "30"

o = s:option(Value, "keepaliveperiod", translate("The keep-alive period.(Unit:second)"))
o:depends({type = "hysteria",flag_quicparam = "1"})
o.rmempty = true
o.default = "10s"
o.datatype = "uinteger"
o.default = "10"

o = s:option(Flag, "disablepathmtudiscovery", translate("Disable Path MTU discovery"))
o:depends({type = "hysteria",flag_quicparam = "1"})
Expand Down Expand Up @@ -767,14 +775,14 @@ o:depends("transport", "kcp")
o.default = 50
o.rmempty = true

o = s:option(Value, "uplink_capacity", translate("Uplink Capacity"))
o = s:option(Value, "uplink_capacity", translate("Uplink Capacity(Default:Mbps)"))
o.datatype = "uinteger"
o:depends("transport", "kcp")
o:depends("type", "hysteria")
o.default = 5
o.rmempty = true

o = s:option(Value, "downlink_capacity", translate("Downlink Capacity"))
o = s:option(Value, "downlink_capacity", translate("Downlink Capacity(Default:Mbps)"))
o.datatype = "uinteger"
o:depends("transport", "kcp")
o:depends("type", "hysteria")
Expand Down Expand Up @@ -832,6 +840,7 @@ o:depends({type = "v2ray", v2ray_protocol = "shadowsocks", reality = false})
o:depends({type = "v2ray", v2ray_protocol = "socks", socks_ver = "5", reality = false})
o:depends({type = "v2ray", v2ray_protocol = "http", reality = false})
o:depends("type", "trojan")
o:depends("type", "hysteria")

-- [[ TLS部分 ]] --
o = s:option(Flag, "tls_sessionTicket", translate("Session Ticket"))
Expand Down Expand Up @@ -887,7 +896,6 @@ o = s:option(Value, "tls_host", translate("TLS Host"))
o.datatype = "hostname"
o:depends("tls", true)
o:depends("reality", true)
o:depends("type", "hysteria")
o.rmempty = true

o = s:option(DynamicList, "tls_alpn", translate("TLS ALPN"))
Expand Down
11 changes: 7 additions & 4 deletions luci-app-ssr-plus/po/zh-cn/ssr-plus.po
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ msgstr "启用端口跃迁"
msgid "Port Range"
msgstr "端口范围值"

msgid "Port Hopping Interval(Unit:Second)"
msgstr "端口跃迁间隔(单位:秒)"

msgid "Enable Lazy Mode"
msgstr "启用懒狗模式"

Expand Down Expand Up @@ -870,11 +873,11 @@ msgstr "最大传输单元"
msgid "TTI"
msgstr "传输时间间隔"

msgid "Uplink Capacity"
msgstr "上行链路容量"
msgid "Uplink Capacity(Default:Mbps)"
msgstr "上行链路容量(默认:Mbps)"

msgid "Downlink Capacity"
msgstr "下行链路容量"
msgid "Downlink Capacity(Default:Mbps)"
msgstr "下行链路容量(默认:Mbps)"

msgid "Read Buffer Size"
msgstr "读取缓冲区大小"
Expand Down
20 changes: 14 additions & 6 deletions luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,20 @@ local hysteria = {
down = tonumber(server.downlink_capacity) and tonumber(server.downlink_capacity) .. " mbps" or nil
},
socks5 = (proto:find("tcp") and tonumber(socks_port) and tonumber(socks_port) ~= 0) and {
listen = "0.0.0.0:" .. tonumber(socks_port),
disable_udp = false
listen = "0.0.0.0:" .. tonumber(socks_port),
disable_udp = false
} or nil,
--[[ tcpTProxy = (proto:find("tcp") and local_port ~= "0") and {
transport = {
type = server.transport_protocol,
udp = {
hopInterval = tonumber(server.hopinterval) and tonumber(server.hopinterval) .. "s" or nil
}
},
--[[
tcpTProxy = (proto:find("tcp") and local_port ~= "0") and {
listen = "0.0.0.0:" .. tonumber(local_port)
} or nil,]]
} or nil,
]]
tcpRedirect = (proto:find("tcp") and local_port ~= "0") and {
listen = "0.0.0.0:" .. tonumber(local_port)
} or nil,
Expand All @@ -305,8 +313,8 @@ local hysteria = {
maxStreamReceiveWindow = (server.maxstreamseceivewindow and server.maxstreamseceivewindow or nil),
initConnReceiveWindow = (server.initconnreceivewindow and server.initconnreceivewindow or nil),
maxConnReceiveWindow = (server.maxconnreceivewindow and server.maxconnreceivewindow or nil),
maxIdleTimeout = (server.maxincomingstreams and server.maxincomingstreams or nil),
keepAlivePeriod = (server.maxincomingstreams and server.keepaliveperiod or nil),
maxIdleTimeout = (tonumber(server.maxidletimeout) and tonumber(server.maxidletimeout) .. "s" or nil),
keepAlivePeriod = (tonumber(server.keepaliveperiod) and tonumber(server.keepaliveperiod) .. "s" or nil),
disable_mtu_discovery = (server.disablepathmtudiscovery == "1") and true or false
} or nil,
auth = server.hy2_auth,
Expand Down

0 comments on commit 06cf02e

Please sign in to comment.