├── luci-udptools ├── README.md ├── src │ ├── luci │ │ ├── i18n │ │ │ └── udptools.zh-cn.lmo │ │ ├── controller │ │ │ └── udptools.lua │ │ ├── model │ │ │ └── cbi │ │ │ │ └── udptools.lua │ │ └── view │ │ │ └── control.htm │ └── etc │ │ ├── config │ │ └── udptools │ │ └── init.d │ │ └── udptools └── Makefile ├── bin ├── lui_udp_kcp.png ├── luci-kcptools_1.0.0-1_all.ipk └── luci-udptools_1.0.0-1_all.ipk ├── luci-kcptools ├── src │ ├── etc │ │ ├── config │ │ │ └── kcptools │ │ └── init.d │ │ │ └── kcptools │ └── luci │ │ ├── model │ │ └── cbi │ │ │ └── kcptools │ │ │ └── kcptools.lua │ │ ├── controller │ │ └── kcptools.lua │ │ └── view │ │ └── kcptools │ │ └── control.htm ├── README.md └── Makefile ├── udpspeeder └── Makefile ├── udp2raw └── Makefile └── README.md /luci-udptools/README.md: -------------------------------------------------------------------------------- 1 | # luci-udptools 2 | openwrt luci for udpspeeder and udp2raw 3 | -------------------------------------------------------------------------------- /bin/lui_udp_kcp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongwenjun/openwrt-luci-kcp-udp/HEAD/bin/lui_udp_kcp.png -------------------------------------------------------------------------------- /bin/luci-kcptools_1.0.0-1_all.ipk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongwenjun/openwrt-luci-kcp-udp/HEAD/bin/luci-kcptools_1.0.0-1_all.ipk -------------------------------------------------------------------------------- /bin/luci-udptools_1.0.0-1_all.ipk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongwenjun/openwrt-luci-kcp-udp/HEAD/bin/luci-udptools_1.0.0-1_all.ipk -------------------------------------------------------------------------------- /luci-udptools/src/luci/i18n/udptools.zh-cn.lmo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hongwenjun/openwrt-luci-kcp-udp/HEAD/luci-udptools/src/luci/i18n/udptools.zh-cn.lmo -------------------------------------------------------------------------------- /luci-kcptools/src/etc/config/kcptools: -------------------------------------------------------------------------------- 1 | config kcpconfig 2 | option password 'passwd' 3 | option client '127.0.0.1' 4 | option server '11.11.11.11' 5 | option serverport '1111' 6 | option auto '1' 7 | option clientport '3333' 8 | option enable '1' 9 | -------------------------------------------------------------------------------- /luci-kcptools/README.md: -------------------------------------------------------------------------------- 1 | # luci-kcptools 2 | openwrt luci for kcp-client and udp2raw 3 | 4 | 5 | ### udp2raw 软件 编译安装 6 | - https://github.com/hongwenjun/openwrt-luci-kcp-udp 7 | 8 | ### kcp-client 软件下载 client_linux 改名成 kcp-client 9 | - https://github.com/xtaci/kcptun/releases 10 | - OpenWRT 存放路径 /usr/bin 11 | -------------------------------------------------------------------------------- /luci-udptools/src/etc/config/udptools: -------------------------------------------------------------------------------- 1 | 2 | config udpconfig 3 | option password 'passwd' 4 | option timeout '0' 5 | option client '127.0.0.1' 6 | option server '11.11.11.11' 7 | option serverport '1111' 8 | option fec '2:4' 9 | option auto '1' 10 | option clientport '3333' 11 | option enable '1' 12 | 13 | -------------------------------------------------------------------------------- /luci-kcptools/src/luci/model/cbi/kcptools/kcptools.lua: -------------------------------------------------------------------------------- 1 | require("luci.sys") 2 | 3 | m = Map("kcptools", translate("KCPTools"), translate("kcp-client and udp2raw")) 4 | 5 | s = m:section(TypedSection, "kcpconfig", "") 6 | s.addremove = false 7 | s.anonymous = true 8 | 9 | server = s:option(Value, "server", translate("UDPServer"), translate("UDPServerDesc")) 10 | serverport = s:option(Value, "serverport", translate("ServerPort"), translate("ServerPortDesc")) 11 | client = s:option(Value, "client", translate("KCPClient"), translate("KCPClientDesc")) 12 | clientport = s:option(Value, "clientport", translate("KCPClientPort"), translate("KCPClientPortDesc")) 13 | password = s:option(Value, "password", translate("Password"), translate("PasswordDesc")) 14 | 15 | return m 16 | -------------------------------------------------------------------------------- /luci-kcptools/src/etc/init.d/kcptools: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | START=90 3 | 4 | run_kcp() 5 | { 6 | local server 7 | local serverport 8 | local client 9 | local clientport 10 | local password 11 | 12 | config_get server $1 server 13 | config_get serverport $1 serverport 14 | config_get client $1 client 15 | config_get clientport $1 clientport 16 | config_get password $1 password 17 | 18 | (kcp-client -r 127.0.0.1:4000 -l :$clientport --key $password -mode fast2 -mtu 1300 >/dev/null 2>&1 )& 19 | (udp2raw -c -l127.0.0.1:4000 -r$server:$serverport --raw-mode faketcp -a -k $password >/dev/null 2>&1 )& 20 | 21 | } 22 | 23 | start() 24 | { 25 | config_load kcptools 26 | config_foreach run_kcp kcpconfig 27 | } 28 | 29 | stop() 30 | { 31 | 32 | killall -9 kcp-client 33 | killall -9 udp2raw 34 | } 35 | -------------------------------------------------------------------------------- /luci-kcptools/src/luci/controller/kcptools.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.kcptools", package.seeall) 2 | 3 | function index() 4 | entry({"admin", "network", "kcptools"}, firstchild(), _("KCPTools")).dependent = false 5 | entry({"admin", "network", "kcptools", "control"}, template("kcptools/control"), _("Control"), 1) 6 | entry({"admin", "network", "kcptools", "config"}, cbi("kcptools/kcptools"), _("Config"), 2) 7 | entry({"admin", "network", "kcptools", "restart"}, call("restart")) 8 | entry({"admin", "network", "kcptools", "stop"}, call("stop")) 9 | end 10 | 11 | function restart() 12 | luci.sys.exec("/etc/init.d/kcptools restart >/dev/null") 13 | luci.template.render("kcptools/control") 14 | end 15 | 16 | function stop() 17 | luci.sys.exec("/etc/init.d/kcptools stop >/dev/null") 18 | luci.template.render("kcptools/control") 19 | end 20 | -------------------------------------------------------------------------------- /luci-udptools/src/luci/controller/udptools.lua: -------------------------------------------------------------------------------- 1 | module("luci.controller.udptools", package.seeall) 2 | 3 | function index() 4 | entry({"admin", "network", "udptools"}, firstchild(), _("UDPTools")).dependent = false 5 | entry({"admin", "network", "udptools", "config"}, cbi("udptools"), _("Config"), 2) 6 | entry({"admin", "network", "udptools", "control"}, template("control"), _("Control"), 1) 7 | entry({"admin", "network", "udptools", "restart"}, call("restart")) 8 | entry({"admin", "network", "udptools", "stop"}, call("stop")) 9 | end 10 | 11 | function restart() 12 | luci.sys.exec("/etc/init.d/udptools restart >/dev/null") 13 | luci.template.render("control") 14 | end 15 | 16 | function stop() 17 | luci.sys.exec("/etc/init.d/udptools stop >/dev/null") 18 | luci.template.render("control") 19 | end 20 | -------------------------------------------------------------------------------- /luci-udptools/src/luci/model/cbi/udptools.lua: -------------------------------------------------------------------------------- 1 | require("luci.sys") 2 | 3 | m = Map("udptools", translate("UDPTools"), translate("udpspeeder and udp2raw")) 4 | 5 | s = m:section(TypedSection, "udpconfig", "") 6 | s.addremove = false 7 | s.anonymous = true 8 | 9 | server = s:option(Value, "server", translate("UDPServer"), translate("UDPServerDesc")) 10 | serverport = s:option(Value, "serverport", translate("ServerPort"), translate("ServerPortDesc")) 11 | client = s:option(Value, "client", translate("UDPClient"), translate("UDPClientDesc")) 12 | clientport = s:option(Value, "clientport", translate("ClientPort"), translate("ClientPortDesc")) 13 | password = s:option(Value, "password", translate("Password"), translate("PasswordDesc")) 14 | fec = s:option(Value, "fec", translate("Fec"), translate("FecDesc")) 15 | timeout = s:option(Value, "timeout", translate("Timeout"), translate("TimeoutDesc")) 16 | 17 | return m 18 | -------------------------------------------------------------------------------- /luci-udptools/src/etc/init.d/udptools: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | START=90 3 | 4 | run_udp() 5 | { 6 | local server 7 | local serverport 8 | local client 9 | local clientport 10 | local password 11 | local fec 12 | local timeout 13 | 14 | config_get server $1 server 15 | config_get serverport $1 serverport 16 | config_get client $1 client 17 | config_get clientport $1 clientport 18 | config_get password $1 password 19 | config_get fec $1 fec 20 | config_get timeout $1 timeout 21 | (udpspeeder -c -l$client:$clientport -r127.0.0.1:21333 -f$fec --mode 0 --timeout $timeout -k $password >/dev/null 2>&1 )& 22 | (udp2raw -c -l127.0.0.1:21333 -r$server:$serverport --raw-mode faketcp -a -k $password >/dev/null 2>&1 )& 23 | ip route add $server via $(ip route | awk '$1=="default" {print $3}') 24 | } 25 | 26 | start() 27 | { 28 | config_load udptools 29 | config_foreach run_udp udpconfig 30 | } 31 | 32 | stop() 33 | { 34 | 35 | killall -9 udpspeeder 36 | killall -9 udp2raw 37 | } 38 | -------------------------------------------------------------------------------- /luci-kcptools/Makefile: -------------------------------------------------------------------------------- 1 | # https://github.com/hongwenjun/ 2 | 3 | include $(TOPDIR)/rules.mk 4 | 5 | PKG_NAME:=luci-kcptools 6 | PKG_VERSION:=1.0.0 7 | PKG_RELEASE:=1 8 | 9 | include $(INCLUDE_DIR)/package.mk 10 | 11 | define Package/$(PKG_NAME) 12 | SECTION:=luci 13 | CATEGORY:=LuCI 14 | SUBMENU:=3. Applications 15 | TITLE:=LuCI for udp2raw and kcp-client 16 | PKGARCH:=all 17 | endef 18 | 19 | define Package/$(PKG_NAME)/description 20 | LuCI for udp2raw and kcp-client. 21 | endef 22 | 23 | define Build/Prepare 24 | endef 25 | 26 | define Build/Configure 27 | endef 28 | 29 | define Build/Compile 30 | endef 31 | 32 | define Package/$(PKG_NAME)/install 33 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller 34 | $(INSTALL_DATA) ./src/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/ 35 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/kcptools 36 | $(INSTALL_DATA) ./src/luci/model/cbi/kcptools/*.lua $(1)/usr/lib/lua/luci/model/cbi/kcptools/ 37 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/kcptools 38 | $(INSTALL_DATA) ./src/luci/view/kcptools/*.htm $(1)/usr/lib/lua/luci/view/kcptools/ 39 | $(INSTALL_DIR) $(1)/etc/config 40 | $(INSTALL_CONF) ./src/etc/config/kcptools $(1)/etc/config/kcptools 41 | $(INSTALL_DIR) $(1)/etc/init.d 42 | $(INSTALL_BIN) ./src/etc/init.d/kcptools $(1)/etc/init.d/kcptools 43 | endef 44 | 45 | $(eval $(call BuildPackage,$(PKG_NAME))) 46 | -------------------------------------------------------------------------------- /luci-udptools/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # author:atrandys 3 | # www.atrandys.com 4 | # 5 | # 6 | 7 | include $(TOPDIR)/rules.mk 8 | 9 | PKG_NAME:=luci-udptools 10 | PKG_VERSION:=1.0.0 11 | PKG_RELEASE:=1 12 | 13 | include $(INCLUDE_DIR)/package.mk 14 | 15 | define Package/$(PKG_NAME) 16 | SECTION:=luci 17 | CATEGORY:=LuCI 18 | SUBMENU:=3. Applications 19 | TITLE:=LuCI for udp2raw and udpspeeder 20 | PKGARCH:=all 21 | endef 22 | 23 | define Package/$(PKG_NAME)/description 24 | LuCI for udp2raw and udpspeeder. 25 | endef 26 | 27 | define Build/Prepare 28 | endef 29 | 30 | define Build/Configure 31 | endef 32 | 33 | define Build/Compile 34 | endef 35 | 36 | define Package/$(PKG_NAME)/install 37 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n 38 | $(INSTALL_DATA) ./src/luci/i18n/udptools.zh-cn.lmo $(1)/usr/lib/lua/luci/i18n/ 39 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller 40 | $(INSTALL_DATA) ./src/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/ 41 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi 42 | $(INSTALL_DATA) ./src/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ 43 | $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view 44 | $(INSTALL_DATA) ./src/luci/view/*.htm $(1)/usr/lib/lua/luci/view/ 45 | $(INSTALL_DIR) $(1)/etc/config 46 | $(INSTALL_CONF) ./src/etc/config/udptools $(1)/etc/config/udptools 47 | $(INSTALL_DIR) $(1)/etc/init.d 48 | $(INSTALL_BIN) ./src/etc/init.d/udptools $(1)/etc/init.d/udptools 49 | endef 50 | 51 | $(eval $(call BuildPackage,$(PKG_NAME))) -------------------------------------------------------------------------------- /luci-udptools/src/luci/view/control.htm: -------------------------------------------------------------------------------- 1 | <%+header%> 2 | <% 3 | local function get_udp_status(name) 4 | local ps = luci.sys.exec("ps | grep -e %s | grep -v grep 2>/dev/null" %{name}) 5 | local status = "" 6 | if ps ~= "" then 7 | status = "Running" 8 | else 9 | status = "Stoped" 10 | end 11 | return status 12 | end 13 | 14 | local udp2raw_status = get_udp_status("udp2raw") 15 | local udpspeeder_status = get_udp_status("udpspeeder") 16 | -%> 17 | 18 |
39 | 48 | 49 | <%+footer%> 50 | 51 | -------------------------------------------------------------------------------- /luci-kcptools/src/luci/view/kcptools/control.htm: -------------------------------------------------------------------------------- 1 | <%+header%> 2 | <% 3 | local function get_kcp_status(name) 4 | local ps = luci.sys.exec("ps | grep -e %s | grep -v grep 2>/dev/null" %{name}) 5 | local status = "" 6 | if ps ~= "" then 7 | status = "Running" 8 | else 9 | status = "Stoped" 10 | end 11 | return status 12 | end 13 | 14 | local udp2raw_status = get_kcp_status("udp2raw") 15 | local kcpclient_status = get_kcp_status("kcp-client") 16 | -%> 17 | 18 | 39 | 48 | 49 | <%+footer%> 50 | 51 | -------------------------------------------------------------------------------- /udpspeeder/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2017 Yu Wang