diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua index f8d9d1e9e4..5546ee7f44 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/sing-box.lua @@ -438,6 +438,7 @@ o = s:option(ListValue, option_name("transport"), translate("Transport")) o:value("tcp", "TCP") o:value("http", "HTTP") o:value("ws", "WebSocket") +o:value("httpupgrade", "HTTPUpgrade") if singbox_tags:find("with_quic") then o:value("quic", "QUIC") end @@ -509,6 +510,14 @@ o:depends({ [option_name("ws_enableEarlyData")] = true }) o = s:option(Value, option_name("ws_earlyDataHeaderName"), translate("Early data header name"), translate("Recommended value: Sec-WebSocket-Protocol")) o:depends({ [option_name("ws_enableEarlyData")] = true }) +-- [[ HTTPUpgrade部分 ]]-- +o = s:option(Value, option_name("httpupgrade_host"), translate("HTTPUpgrade Host")) +o:depends({ [option_name("transport")] = "httpupgrade" }) + +o = s:option(Value, option_name("httpupgrade_path"), translate("HTTPUpgrade Path")) +o.placeholder = "/" +o:depends({ [option_name("transport")] = "httpupgrade" }) + -- [[ gRPC部分 ]]-- o = s:option(Value, option_name("grpc_serviceName"), "ServiceName") o:depends({ [option_name("transport")] = "grpc" }) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua index 48e6832351..9b659b5994 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/server/type/sing-box.lua @@ -310,6 +310,7 @@ o = s:option(ListValue, option_name("transport"), translate("Transport")) o:value("tcp", "TCP") o:value("http", "HTTP") o:value("ws", "WebSocket") +o:value("httpupgrade", "HTTPUpgrade") o:value("quic", "QUIC") o:value("grpc", "gRPC") o:depends({ [option_name("protocol")] = "shadowsocks" }) @@ -333,6 +334,14 @@ o:depends({ [option_name("transport")] = "ws" }) o = s:option(Value, option_name("ws_path"), translate("WebSocket Path")) o:depends({ [option_name("transport")] = "ws" }) +-- [[ HTTPUpgrade部分 ]]-- + +o = s:option(Value, option_name("httpupgrade_host"), translate("HTTPUpgrade Host")) +o:depends({ [option_name("transport")] = "httpupgrade" }) + +o = s:option(Value, option_name("httpupgrade_path"), translate("HTTPUpgrade Path")) +o:depends({ [option_name("transport")] = "httpupgrade" }) + -- [[ gRPC部分 ]]-- o = s:option(Value, option_name("grpc_serviceName"), "ServiceName") o:depends({ [option_name("transport")] = "grpc" }) diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index 1dbb25f84d..5c05ddb403 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -146,6 +146,14 @@ function gen_outbound(flag, node, tag, proxy_table) } end + if node.transport == "httpupgrade" then + v2ray_transport = { + type = "httpupgrade", + host = node.httpupgrade_host, + path = node.httpupgrade_path or "/", + } + end + if node.transport == "quic" then v2ray_transport = { type = "quic" @@ -421,6 +429,14 @@ function gen_config_server(node) } end + if node.transport == "httpupgrade" then + v2ray_transport = { + type = "httpupgrade", + host = node.httpupgrade_host, + path = node.httpupgrade_path or "/", + } + end + if node.transport == "quic" then v2ray_transport = { type = "quic"