未验证 提交 bae6e7fc 编写于 作者: H hyird 提交者: GitHub

luci-app-frpc: add plugin "https2http" (#4754)

* Update config.lua

* Update frp

* Update frp.po
上级 901efc2d
......@@ -105,6 +105,27 @@ e:depends("type","http")
e = t:taboption("other",Value, "host_header_rewrite", translate("Host Header"), translate("The Host header will be rewritten to match the hostname portion of the forwarding address."))
e.default = "dev.yourdomain.com"
e:depends("enable_host_header_rewrite",1)
e=t:taboption("other",Flag,"enable_https_plugin",translate("Use Plugin"))
e.default="0"
e:depends("type","https")
e=t:taboption("other",ListValue,"https_plugin",translate("Choose Plugin"),translate("If plugin is defined, local_ip and local_port is useless, plugin will handle connections got from frps."))
e:value("https2http",translate("https2http"))
e:depends("enable_https_plugin",1)
e=t:taboption("other",Value,"plugin_local_addr",translate("Plugin_Local_Addr"))
e.default="127.0.0.1:80"
e:depends("https_plugin","https2http")
e=t:taboption("other",Value,"plugin_crt_path",translate("plugin_crt_path"))
e.default="./server.crt"
e:depends("https_plugin","https2http")
e=t:taboption("other",Value,"plugin_key_path",translate("plugin_key_path"))
e.default="./server.key"
e:depends("https_plugin","https2http")
e=t:taboption("other",Value,"plugin_host_header_rewrite",translate("plugin_host_header_rewrite"))
e.default="127.0.0.1"
e:depends("https_plugin","https2http")
e=t:taboption("other",Value,"plugin_header_X_From_Where",translate("plugin_header_X-From-Where"))
e.default="frp"
e:depends("https_plugin","https2http")
e = t:taboption("base",ListValue, "proxy_protocol_version", translate("Proxy-Protocol Version"), translate("Proxy Protocol to send user's real IP to local services."))
e.default = "disable"
e:value("disable",translate("Disable"))
......
......@@ -252,4 +252,19 @@ msgid "STCP Server Name is Service Remark Name of STCP Server"
msgstr "STCP服务器别名"
msgid "<font color=\"red\">Please ensure the remark name is unique.</font>"
msgstr "<font color=\"red\">确保备注名唯一</font>"
\ No newline at end of file
msgstr "<font color=\"red\">确保备注名唯一</font>"
msgid "Plugin_Local_Addr"
msgstr "插件本地地址(格式 IP:Port)"
msgid "plugin_crt_path"
msgstr "插件证书路径"
msgid "plugin_key_path"
msgstr "插件私钥路径"
msgid "plugin_host_header_rewrite"
msgstr "插件 Host Header 重写"
msgid "plugin_header_X-From-Where"
msgstr "插件X-From-Where请求头"
......@@ -32,6 +32,7 @@ conf_proxy_add() {
local enable type domain_type custom_domains remote_port local_ip local_port enable_http_auth enable_host_header_rewrite host_header_rewrite
local subdomain proxy_protocol_version use_encryption use_compression http_user http_pwd remark locations
local enable_plugin plugin plugin_http_user plugin_http_passwd plugin_unix_path stcp_role stcp_secretkey stcp_servername
local enable_https_plugin https_plugin plugin_local_addr plugin_crt_path plugin_key_path plugin_host_header_rewrite plugin_header_X_From_Where
config_get_bool enable "$cfg" enable 1
[ "$enable" -gt 0 ] || return 1
......@@ -55,6 +56,12 @@ conf_proxy_add() {
config_get stcp_secretkey "$cfg" stcp_secretkey
config_get stcp_servername "$cfg" stcp_servername
config_get proxy_protocol_version "$cfg" proxy_protocol_version
config_get https_plugin "$cfg" https_plugin
config_get plugin_local_addr "$cfg" plugin_local_addr
config_get plugin_crt_path "$cfg" plugin_crt_path
config_get plugin_key_path "$cfg" plugin_key_path
config_get plugin_host_header_rewrite "$cfg" plugin_host_header_rewrite
config_get plugin_header_X_From_Where "$cfg" plugin_header_X_From_Where
[ -n "$remark" ] && [ -n "$type" ] || return 1
......@@ -99,6 +106,15 @@ conf_proxy_add() {
fi
}
[ -n "$https_plugin" ] && echo "plugin=$https_plugin" >>$tmpconf
[ -n "$plugin_local_addr" ] && echo "plugin_local_addr=$plugin_local_addr" >>$tmpconf
[ -n "$plugin_crt_path" -a -n "$plugin_key_path" ] && {
echo "plugin_crt_path=$plugin_crt_path" >>$tmpconf
echo "plugin_key_path=$plugin_key_path" >>$tmpconf
}
[ -n "$plugin_host_header_rewrite" ] && echo "plugin_host_header_rewrite=$plugin_host_header_rewrite" >>$tmpconf
[ -n "$plugin_header_X_From_Where" ] && echo "plugin_header_X_From_Where=$plugin_header_X_From_Where" >>$tmpconf
frp_write_bool use_encryption $cfg 1
frp_write_bool use_compression $cfg 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册