From 13018802c45a5e387780d9a23a4a20436b391139 Mon Sep 17 00:00:00 2001 From: Ray Wang Date: Wed, 14 Aug 2024 21:16:11 +0800 Subject: [PATCH] hev-socks5-tproxy: add new package HevSocks5TProxy is a simple, lightweight transparent proxy for Linux. More details: https://github.com/heiher/hev-socks5-tproxy Signed-off-by: Ray Wang --- net/hev-socks5-tproxy/Makefile | 53 +++++++++++++++++++ .../files/hev-socks5-tproxy.config | 3 ++ .../files/hev-socks5-tproxy.init | 34 ++++++++++++ net/hev-socks5-tproxy/test.sh | 3 ++ 4 files changed, 93 insertions(+) create mode 100644 net/hev-socks5-tproxy/Makefile create mode 100644 net/hev-socks5-tproxy/files/hev-socks5-tproxy.config create mode 100644 net/hev-socks5-tproxy/files/hev-socks5-tproxy.init create mode 100755 net/hev-socks5-tproxy/test.sh diff --git a/net/hev-socks5-tproxy/Makefile b/net/hev-socks5-tproxy/Makefile new file mode 100644 index 0000000000..64a8242ebb --- /dev/null +++ b/net/hev-socks5-tproxy/Makefile @@ -0,0 +1,53 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=hev-socks5-tproxy +PKG_VERSION:=2.5.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/heiher/hev-socks5-tproxy/releases/download/$(PKG_VERSION) +PKG_HASH:=b5f29fef18ffe335fce4d6f96ce83c8bee04ce29fda420ba7248252d3b210578 + +PKG_MAINTAINER:=Ray Wang +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=License + +PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/hev-socks5-tproxy + SECTION:=net + CATEGORY:=Network + TITLE:=A simple, lightweight socks5 transparent proxy for Linux + URL:=https://github.com/heiher/hev-socks5-tproxy +endef + +define Package/hev-socks5-tproxy/description +hev-socks5-tproxy is a lightweight tool that enables transparent proxying of +network traffic through a SOCKS5 proxy. It’s designed to enhance privacy, bypass +restrictions, and improve connectivity without requiring manual configuration on +client devices. +endef + +define Package/hev-socks5-tproxy/conffiles +/etc/config/hev-socks5-tproxy +/etc/hev-socks5-tproxy/ +endef + +define Package/hev-socks5-tproxy/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/hev-socks5-tproxy $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/hev-socks5-tproxy/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/main.yml $(1)/etc/hev-socks5-tproxy/main.yml + + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_CONF) ./files/hev-socks5-tproxy.config $(1)/etc/config/hev-socks5-tproxy + + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/hev-socks5-tproxy.init $(1)/etc/init.d/hev-socks5-tproxy +endef + +$(eval $(call BuildPackage,hev-socks5-tproxy)) diff --git a/net/hev-socks5-tproxy/files/hev-socks5-tproxy.config b/net/hev-socks5-tproxy/files/hev-socks5-tproxy.config new file mode 100644 index 0000000000..10b94e435a --- /dev/null +++ b/net/hev-socks5-tproxy/files/hev-socks5-tproxy.config @@ -0,0 +1,3 @@ +config hev-socks5-tproxy 'config' + option enabled '0' + option conffile '/etc/hev-socks5-tproxy/main.yml' diff --git a/net/hev-socks5-tproxy/files/hev-socks5-tproxy.init b/net/hev-socks5-tproxy/files/hev-socks5-tproxy.init new file mode 100644 index 0000000000..4d97024020 --- /dev/null +++ b/net/hev-socks5-tproxy/files/hev-socks5-tproxy.init @@ -0,0 +1,34 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=99 + +CONF="hev-socks5-tproxy" +PROG="/usr/bin/hev-socks5-tproxy" + +start_service() { + config_load "$CONF" + + local enabled + config_get_bool enabled "config" "enabled" "0" + [ "$enabled" -eq "1" ] || return 1 + + local conffile + config_get conffile "config" "conffile" + + procd_open_instance "$CONF" + procd_set_param command "$PROG" "$conffile" + procd_set_param file "$conffile" + + procd_set_param limits core="unlimited" + procd_set_param limits nofile="1000000 1000000" + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_set_param respawn + + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger "$CONF" +} diff --git a/net/hev-socks5-tproxy/test.sh b/net/hev-socks5-tproxy/test.sh new file mode 100755 index 0000000000..9ae615ccdc --- /dev/null +++ b/net/hev-socks5-tproxy/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +"$1" 2>&1 | grep "$2" -- 2.30.2