2 # Copyright (C) 2012 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
11 PKG_RELEASE=$(PKG_SOURCE_VERSION)
14 PKG_SOURCE_URL:=https://github.com/darkk/redsocks.git
15 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE_VERSION:=a9cfd090119385a1ef973baf94342a2db20595b9
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19 include $(INCLUDE_DIR)/package.mk
21 define Package/redsocks
24 SUBMENU:=Web Servers/Proxies
26 TITLE:=Redirect any TCP connection to a SOCKS or HTTPS proxy server
29 define Package/redsocks/description
30 Redsocks is a daemon running on the local system, that will transparently
31 tunnel any TCP connection via a remote SOCKS4, SOCKS5 or HTTP proxy server. It
32 uses the system firewall's redirection facility to intercept TCP connections,
33 thus the redirection is system-wide, with fine-grained control, and does
34 not depend on LD_PRELOAD libraries.
36 Redsocks supports tunneling TCP connections and UDP packets. It has
37 authentication support for both, SOCKS and HTTP proxies.
39 Also included is a small DNS server returning answers with the "truncated" flag
40 set for any UDP query, forcing the resolver to use TCP.
43 define Package/redsocks/install
44 $(INSTALL_DIR) $(1)/usr/sbin
45 $(INSTALL_BIN) $(PKG_BUILD_DIR)/redsocks $(1)/usr/sbin/
46 $(INSTALL_DIR) $(1)/etc/init.d
47 $(INSTALL_BIN) ./files/redsocks.init $(1)/etc/init.d/redsocks
48 $(INSTALL_DIR) $(1)/etc
49 $(INSTALL_CONF) $(PKG_BUILD_DIR)/redsocks.conf.example $(1)/etc/redsocks.conf
52 $(eval $(call BuildPackage,redsocks))