Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luci-app-ssr-plus: Add options menu for httpupgrade #1433

Merged
merged 4 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ o = s:option(ListValue, "transport", translate("Transport"))
o:value("tcp", "TCP")
o:value("kcp", "mKCP")
o:value("ws", "WebSocket")
o:value("httpupgrade", "HTTPUpgrade")
o:value("h2", "HTTP/2")
o:value("quic", "QUIC")
o:value("grpc", "gRPC")
Expand Down Expand Up @@ -674,6 +675,18 @@ if is_finded("v2ray") then
o.rmempty = true
end

-- [[ httpupgrade部分 ]]--

-- httpupgrade域名
o = s:option(Value, "httpupgrade_host", translate("Httpupgrade Host"))
o:depends({transport = "httpupgrade", tls = false})
o.rmempty = true

-- httpupgrade路径
o = s:option(Value, "httpupgrade_path", translate("Httpupgrade Path"))
o:depends("transport", "httpupgrade")
o.rmempty = true

-- [[ H2部分 ]]--

-- H2域名
Expand Down
6 changes: 6 additions & 0 deletions luci-app-ssr-plus/po/zh-cn/ssr-plus.po
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,12 @@ msgstr "最大前置数据"
msgid "Early Data Header Name"
msgstr "前置数据标头"

msgid "Httpupgrade Host"
msgstr "HTTPUpgrade 主机名"

msgid "Httpupgrade Path"
msgstr "HTTPUpgrade 路径"

msgid "HTTP/2 Host"
msgstr "HTTP/2 主机名"

Expand Down
5 changes: 5 additions & 0 deletions luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ local Xray = {
maxEarlyData = tonumber(server.ws_ed) or nil,
earlyDataHeaderName = server.ws_ed_header or nil
} or nil,
httpupgradeSettings = (server.transport == "httpupgrade") and {
-- httpupgrade
host = (server.httpupgrade_host or server.tls_host) or nil,
path = server.httpupgrade_path or ""
} or nil,
httpSettings = (server.transport == "h2") and {
-- h2
path = server.h2_path or "",
Expand Down
Loading