add http/2 option in v2ray pro

This commit is contained in:
tansuo 2018-10-20 21:16:20 +08:00 committed by coolsnowwolf
parent 51a3526595
commit 4fc65fc04b
2 changed files with 16 additions and 0 deletions

View File

@ -100,6 +100,7 @@ network_type = s:taboption("main",ListValue, "network_type", translate("Network
network_type:value("tcp")
network_type:value("kcp")
network_type:value("ws")
network_type:value("h2")
-- tcp settings
tcp_obfs = s:taboption("main",ListValue, "tcp_obfs", translate("TCP Obfs"))
@ -159,6 +160,14 @@ ws_headers = s:taboption("main",Value, "ws_headers", translate("WebSocket Header
ws_headers:depends("network_type", "ws")
ws_headers.datatype = "host"
-- http/2 settings
h2_path = s:taboption("main",Value, "h2_path", translate("HTTP Path"))
h2_path:depends("network_type", "h2")
h2_domain = s:taboption("main",Value, "h2_domain", translate("HTTP Domain"))
h2_domain:depends("network_type", "h2")
h2_domain.datatype = "host"
-- others
tls = s:taboption("main",Flag, "tls", translate("TLS"))
tls.rmempty = false

View File

@ -137,6 +137,13 @@ local v2ray = {
Host = ucursor:get(conf_path, "v2raypro", "ws_headers")
} or nil,
} or nil,
httpSettings = (v2ray_stream_mode == "h2") and {
path = ucursor:get(conf_path, "v2raypro", "h2_path"),
host = (ucursor:get(conf_path, "v2raypro", "h2_domain") ~= nil) and {
ucursor:get(conf_path, "v2raypro", "h2_domain")
} or nil,
} or nil,
},
mux = {
enabled = (ucursor:get(conf_path, "v2raypro", "mux") == "1") and true or false