diff --git a/package/lean/luci-app-frpc/Makefile b/package/lean/luci-app-frpc/Makefile index 911ad624d4..ed9bb9c865 100644 --- a/package/lean/luci-app-frpc/Makefile +++ b/package/lean/luci-app-frpc/Makefile @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI for FRPC LUCI_DEPENDS:=+wget +frpc LUCI_PKGARCH:=all -PKG_VERSION:=1.1 -PKG_RELEASE:=2 +PKG_VERSION:=1.2 +PKG_RELEASE:=1 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo b/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo index f3b95348f8..9e48c9b3fa 100644 Binary files a/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo and b/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo differ diff --git a/package/lean/luci-app-frpc/luasrc/model/cbi/frp/config.lua b/package/lean/luci-app-frpc/luasrc/model/cbi/frp/config.lua index 48bfe72509..b015ff7ad4 100644 --- a/package/lean/luci-app-frpc/luasrc/model/cbi/frp/config.lua +++ b/package/lean/luci-app-frpc/luasrc/model/cbi/frp/config.lua @@ -105,6 +105,15 @@ 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("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")) +e:value("v1",translate("V1")) +e:value("v2",translate("V2")) +e:depends("type","tcp") +e:depends("type","stcp") +e:depends("type","http") +e:depends("type","https") e = t:taboption("base",Flag, "use_encryption", translate("Use Encryption"), translate("Encrypted the communication between frpc and frps, will effectively prevent the traffic intercepted.")) e.default = "1" e.rmempty = false diff --git a/package/lean/luci-app-frpc/root/etc/init.d/frp b/package/lean/luci-app-frpc/root/etc/init.d/frp index ced13f7bb3..cde1c0ebea 100755 --- a/package/lean/luci-app-frpc/root/etc/init.d/frp +++ b/package/lean/luci-app-frpc/root/etc/init.d/frp @@ -30,7 +30,7 @@ conf_proxy_add() { local cfg="$1" local tmpconf="$2" 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 use_encryption use_compression http_user http_pwd remark locations + 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 config_get_bool enable "$cfg" enable 1 @@ -54,6 +54,7 @@ conf_proxy_add() { config_get stcp_role "$cfg" stcp_role config_get stcp_secretkey "$cfg" stcp_secretkey config_get stcp_servername "$cfg" stcp_servername + config_get proxy_protocol_version "$cfg" proxy_protocol_version [ -n "$remark" ] && [ -n "$type" ] || return 1 @@ -92,7 +93,11 @@ conf_proxy_add() { [ -n "$stcp_secretkey" ] && echo "sk=$stcp_secretkey" >>$tmpconf || return 1 } - + [ -n "$proxy_protocol_version" ] && { + if [ "$proxy_protocol_version" != "disable" ]; then + echo "proxy_protocol_version=$proxy_protocol_version" >>$tmpconf + fi + } frp_write_bool use_encryption $cfg 1 frp_write_bool use_compression $cfg 1