From 5e96181fcc615f8d1f0c104152dfeeff5b68e966 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Fri, 6 Mar 2020 01:29:29 -0800 Subject: [PATCH 1/2] luci-app-ssr-plus: socks listens on IPv6 --- package/lean/luci-app-ssr-plus/Makefile | 4 ++-- .../luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index e0e3ac0a60..fbc2fd4e9f 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus PKG_VERSION:=163 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) @@ -43,7 +43,7 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server config PACKAGE_$(PKG_NAME)_INCLUDE_DNS2SOCKS bool "Include DNS2SOCKS" - default n + default y if x86_64 endef define Package/$(PKG_NAME) diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 48d0265ad7..08dfe8b36e 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -90,7 +90,7 @@ gen_config_file() { { "server": "$hostip", "server_port": $(uci_get_by_name $1 server_port), - "local_address": "0.0.0.0", + "local_address": "::", "local_port": $(uci_get_by_name $1 local_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), @@ -111,7 +111,7 @@ gen_config_file() { { "server": "$hostip", "server_port": $(uci_get_by_name $1 server_port), - "local_address": "0.0.0.0", + "local_address": "::", "local_port": $(uci_get_by_name $1 local_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), @@ -413,7 +413,7 @@ gen_service_file() { fi cat <<-EOF >$2 { - "server": "0.0.0.0", + "server": "::", "server_port": $(uci_get_by_name $1 server_port), "password": "$(uci_get_by_name $1 password)", "timeout": $(uci_get_by_name $1 timeout 60), @@ -478,9 +478,9 @@ start_local() { local auth_enable=$(uci_get_by_type socks5_proxy auth_enable 0) local socks_port=$(uci_get_by_type socks5_proxy local_port 1080) if [ "$auth_enable" == "1" ]; then - microsocks -i 0.0.0.0 -p $socks_port -1 -u $(uci_get_by_type socks5_proxy username) -P $(uci_get_by_type socks5_proxy password) ssr-socks >/dev/null 2>&1 & + microsocks -i :: -p $socks_port -1 -u $(uci_get_by_type socks5_proxy username) -P $(uci_get_by_type socks5_proxy password) ssr-socks >/dev/null 2>&1 & else - microsocks -i 0.0.0.0 -p $socks_port ssr-socks >/dev/null 2>&1 & + microsocks -i :: -p $socks_port ssr-socks >/dev/null 2>&1 & fi local_enable=1 if [ "$(uci_get_by_type socks5_proxy wan_enable 0)" == "1" ]; then From 2bcfd29252595fffbf7f156af00c6a8e6763b9e3 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Fri, 6 Mar 2020 01:48:34 -0800 Subject: [PATCH 2/2] luci-app-ssr-plus: add Trojan udp relay IPv6 support --- package/lean/luci-app-ssr-plus/Makefile | 4 ++-- package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package/lean/luci-app-ssr-plus/Makefile b/package/lean/luci-app-ssr-plus/Makefile index fbc2fd4e9f..abe9880cb0 100644 --- a/package/lean/luci-app-ssr-plus/Makefile +++ b/package/lean/luci-app-ssr-plus/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-ssr-plus PKG_VERSION:=163 -PKG_RELEASE:=3 +PKG_RELEASE:=6 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) @@ -52,7 +52,7 @@ define Package/$(PKG_NAME) SUBMENU:=3. Applications TITLE:=SS/SSR/V2Ray/Trojan LuCI interface PKGARCH:=all - DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +pdnsd-alt +wget +lua +microsocks \ + DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +pdnsd-alt +wget +lua +microsocks +ipt2socks \ +PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \ +PACKAGE_$(PKG_NAME)_INCLUDE_Simple_obfs:simple-obfs \ +PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_plugin:v2ray-plugin \ diff --git a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr index 08dfe8b36e..9a1023beb9 100755 --- a/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr +++ b/package/lean/luci-app-ssr-plus/root/etc/init.d/shadowsocksr @@ -360,8 +360,7 @@ start_redir() { lua /usr/share/shadowsocksr/gentrojanconfig.lua $GLOBAL_SERVER client 10801 >/var/etc/trojan-ssr-reudp.json sed -i 's/\\//g' /var/etc/trojan-ssr-reudp.json $ucmd --config /var/etc/trojan-ssr-reudp.json >/dev/null 2>&1 & - /usr/share/shadowsocksr/genred2config.sh "/var/etc/redsocks-ssr-reudp.conf" socks5 udp $(uci_get_by_name $UDP_RELAY_SERVER local_port) 127.0.0.1 10801 0 - /usr/sbin/redsocks2 -c /var/etc/redsocks-ssr-reudp.conf >/dev/null 2>&1 + ipt2socks -U -b 0.0.0.0 -B :: -s 127.0.0.1 -p 10801 -l $(uci_get_by_name $UDP_RELAY_SERVER local_port) >/dev/null 2>&1 & elif [ "$utype" == "socks5" ]; then /usr/share/shadowsocksr/genred2config.sh "/var/etc/redsocks-ssr-reudp.conf" socks5 udp $(uci_get_by_name $UDP_RELAY_SERVER local_port) $(uci_get_by_name $UDP_RELAY_SERVER server) $(uci_get_by_name $UDP_RELAY_SERVER server_port) \ $(uci_get_by_name $UDP_RELAY_SERVER auth_enable 0) $(uci_get_by_name $UDP_RELAY_SERVER username) $(uci_get_by_name $UDP_RELAY_SERVER password)