update 2023-09-23 22:23:12

This commit is contained in:
github-actions[bot] 2023-09-23 22:23:13 +08:00
parent f19bb030c8
commit b9670c3232
4 changed files with 451 additions and 511 deletions

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=shadowsocks-rust
PKG_VERSION:=1.16.1
PKG_VERSION:=1.16.2
PKG_RELEASE:=1
PKG_SOURCE_HEADER:=shadowsocks-v$(PKG_VERSION)
@ -16,29 +16,29 @@ PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-rust/releases/downloa
ifeq ($(ARCH),aarch64)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).aarch64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=8927a96fcb9f52001944947b93e066820ffc52fdbd7d7228b7e5f84bee59dd71
PKG_HASH:=04fb797d8d04b8af9c4746ab9c1d659a3575a677892c2d5d9194a4b0e210e2ab
else ifeq ($(ARCH),arm)
# Referred to golang/golang-values.mk
ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
ifeq ($(ARM_CPU_FEATURES),)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabi.$(PKG_SOURCE_FOOTER)
PKG_HASH:=ec8bd1bcbfa54f19e09d2702f7e67c2b2957f7fb8ecff8d8c9cd883c96a38b10
PKG_HASH:=skip
else
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER)
PKG_HASH:=66904128095f204f5726b63ab670da4ffede59f2f762cd71128fee9a5006dabc
PKG_HASH:=skip
endif
else ifeq ($(ARCH),i386)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).i686-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=d7429ecb29f47399caaf3ed7e61f318566cc02f6bd619c0d87dcb955ce9fdf53
PKG_HASH:=skip
else ifeq ($(ARCH),mips)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mips-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=816d836a5eaee8ae6b891ae1d307c26c2135de00f55dcc0f1dfd572fc1d1a809
PKG_HASH:=skip
else ifeq ($(ARCH),mipsel)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mipsel-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=3d5c564e9e2352fd304f59572016b9562de9cf93d2d0f1b27f1c5fe4dd6e4a8f
PKG_HASH:=skip
else ifeq ($(ARCH),x86_64)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).x86_64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
PKG_HASH:=19149e63ef4e375e6963c75a3fff3732204c5d14d75d0e0dfdb53e339cbcf5f3
PKG_HASH:=skip
# Set the default value to make OpenWrt Package Checker happy
else
PKG_SOURCE:=dummy

View File

@ -1,156 +1,156 @@
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=sing-box
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=sing-box
PKG_VERSION:=1.5.0-rc.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)?
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=fdb0a944dc4c84e81ff473841ef922cb7a2806064a5d59c71bd5c17ac0ac01df
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_FLAGS:=no-mips16
GO_PKG:=github.com/sagernet/sing-box
GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd/sing-box
GO_PKG_LDFLAGS_X:=$(GO_PKG)/constant.Version=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=The universal proxy platform.
URL:=https://sing-box.sagernet.org
DEPENDS:=$(GO_ARCH_DEPENDS) \
+ca-bundle \
+kmod-inet-diag \
+kmod-netlink-diag \
+kmod-tun
endef
define Package/$(PKG_NAME)/description
Sing-box is a universal proxy platform which supports hysteria, SOCKS, Shadowsocks,
ShadowsocksR, ShadowTLS, Tor, trojan, VLess, VMess, WireGuard and so on.
endef
GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
define Package/$(PKG_NAME)/config
menu "Customizing build tags"
depends on PACKAGE_sing-box
config SING_BOX_WITH_ACME
bool "Build with ACME TLS certificate issuer support"
default n
config SING_BOX_WITH_CLASH_API
bool "Build with Clash API support (EXPERIMENTAL!!!)"
default y
config SING_BOX_WITH_DHCP
bool "Build with DHCP support"
default y
config SING_BOX_WITH_ECH
bool "Build with TLS ECH extension support"
default y
config SING_BOX_WITH_GRPC
bool "Build with standard gRPC support"
default n
help
sing-box has better performance gun-lite gRPC built-in by default.
This standard gRPC has better compatibility but poor performance.
config SING_BOX_WITH_GVISOR
bool "Build with gVisor support"
default n
config SING_BOX_WITH_QUIC
bool "Build with QUIC support"
default y
help
Required by HTTP3 DNS transports, Naive inbound,
Hysteria inbound / outbound, and v2ray QUIC transport.
config SING_BOX_WITH_REALITY_SERVER
bool "Build with reality TLS server support"
default n
config SING_BOX_WITH_SHADOWSOCKSR
bool "Build with ShadowsockR support"
default n
config SING_BOX_WITH_UTLS
bool "Build with uTLS support"
default y
config SING_BOX_WITH_V2RAY_API
bool "Build with V2Ray API support (EXPERIMENTAL!!!)"
default n
config SING_BOX_WITH_WIREGUARD
bool "Build with WireGuard support"
default y
endmenu
endef
PKG_CONFIG_DEPENDS:= \
CONFIG_SING_BOX_WITH_ACME \
CONFIG_SING_BOX_WITH_CLASH_API \
CONFIG_SING_BOX_WITH_DHCP \
CONFIG_SING_BOX_WITH_ECH \
CONFIG_SING_BOX_WITH_GRPC \
CONFIG_SING_BOX_WITH_GVISOR \
CONFIG_SING_BOX_WITH_QUIC \
CONFIG_SING_BOX_WITH_REALITY_SERVER \
CONFIG_SING_BOX_WITH_SHADOWSOCKSR \
CONFIG_SING_BOX_WITH_UTLS \
CONFIG_SING_BOX_WITH_V2RAY_API \
CONFIG_SING_BOX_WITH_WIREGUARD
GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \
$(if $(CONFIG_SING_BOX_WITH_ACME),with_acme) \
$(if $(CONFIG_SING_BOX_WITH_CLASH_API),with_clash_api) \
$(if $(CONFIG_SING_BOX_WITH_DHCP),with_dhcp) \
$(if $(CONFIG_SING_BOX_WITH_ECH),with_ech) \
$(if $(CONFIG_SING_BOX_WITH_GRPC),with_grpc) \
$(if $(CONFIG_SING_BOX_WITH_GVISOR),with_gvisor) \
$(if $(CONFIG_SING_BOX_WITH_QUIC),with_quic) \
$(if $(CONFIG_SING_BOX_WITH_REALITY_SERVER),with_reality_server) \
$(if $(CONFIG_SING_BOX_WITH_SHADOWSOCKSR),with_shadowsocksr) \
$(if $(CONFIG_SING_BOX_WITH_UTLS),with_utls) \
$(if $(CONFIG_SING_BOX_WITH_V2RAY_API),with_v2ray_api) \
$(if $(CONFIG_SING_BOX_WITH_WIREGUARD),with_wireguard) \
))
define Package/$(PKG_NAME)/conffiles
/etc/sing-box/config.json
endef
define Package/$(PKG_NAME)/install
$(call GoPackage/Package/Install/Bin,$(1))
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/sing-box.init $(1)/etc/init.d/sing-box
$(INSTALL_DIR) $(1)/etc/sing-box
$(INSTALL_DATA) ./files/config.json.example $(1)/etc/sing-box/config.json.example
endef
$(eval $(call GoBinPackage,sing-box))
$(eval $(call BuildPackage,sing-box))
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_FLAGS:=no-mips16
GO_PKG:=github.com/sagernet/sing-box
GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd/sing-box
GO_PKG_LDFLAGS_X:=$(GO_PKG)/constant.Version=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=The universal proxy platform.
URL:=https://sing-box.sagernet.org
DEPENDS:=$(GO_ARCH_DEPENDS) \
+ca-bundle \
+kmod-inet-diag \
+kmod-netlink-diag \
+kmod-tun
endef
define Package/$(PKG_NAME)/description
Sing-box is a universal proxy platform which supports hysteria, SOCKS, Shadowsocks,
ShadowsocksR, ShadowTLS, Tor, trojan, VLess, VMess, WireGuard and so on.
endef
GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
define Package/$(PKG_NAME)/config
menu "Customizing build tags"
depends on PACKAGE_sing-box
config SING_BOX_WITH_ACME
bool "Build with ACME TLS certificate issuer support"
default n
config SING_BOX_WITH_CLASH_API
bool "Build with Clash API support (EXPERIMENTAL!!!)"
default y
config SING_BOX_WITH_DHCP
bool "Build with DHCP support"
default y
config SING_BOX_WITH_ECH
bool "Build with TLS ECH extension support"
default y
config SING_BOX_WITH_GRPC
bool "Build with standard gRPC support"
default n
help
sing-box has better performance gun-lite gRPC built-in by default.
This standard gRPC has better compatibility but poor performance.
config SING_BOX_WITH_GVISOR
bool "Build with gVisor support"
default n
config SING_BOX_WITH_QUIC
bool "Build with QUIC support"
default y
help
Required by HTTP3 DNS transports, Naive inbound,
Hysteria inbound / outbound, and v2ray QUIC transport.
config SING_BOX_WITH_REALITY_SERVER
bool "Build with reality TLS server support"
default n
config SING_BOX_WITH_SHADOWSOCKSR
bool "Build with ShadowsockR support"
default n
config SING_BOX_WITH_UTLS
bool "Build with uTLS support"
default y
config SING_BOX_WITH_V2RAY_API
bool "Build with V2Ray API support (EXPERIMENTAL!!!)"
default n
config SING_BOX_WITH_WIREGUARD
bool "Build with WireGuard support"
default y
endmenu
endef
PKG_CONFIG_DEPENDS:= \
CONFIG_SING_BOX_WITH_ACME \
CONFIG_SING_BOX_WITH_CLASH_API \
CONFIG_SING_BOX_WITH_DHCP \
CONFIG_SING_BOX_WITH_ECH \
CONFIG_SING_BOX_WITH_GRPC \
CONFIG_SING_BOX_WITH_GVISOR \
CONFIG_SING_BOX_WITH_QUIC \
CONFIG_SING_BOX_WITH_REALITY_SERVER \
CONFIG_SING_BOX_WITH_SHADOWSOCKSR \
CONFIG_SING_BOX_WITH_UTLS \
CONFIG_SING_BOX_WITH_V2RAY_API \
CONFIG_SING_BOX_WITH_WIREGUARD
GO_PKG_TAGS:=$(subst $(space),$(comma),$(strip \
$(if $(CONFIG_SING_BOX_WITH_ACME),with_acme) \
$(if $(CONFIG_SING_BOX_WITH_CLASH_API),with_clash_api) \
$(if $(CONFIG_SING_BOX_WITH_DHCP),with_dhcp) \
$(if $(CONFIG_SING_BOX_WITH_ECH),with_ech) \
$(if $(CONFIG_SING_BOX_WITH_GRPC),with_grpc) \
$(if $(CONFIG_SING_BOX_WITH_GVISOR),with_gvisor) \
$(if $(CONFIG_SING_BOX_WITH_QUIC),with_quic) \
$(if $(CONFIG_SING_BOX_WITH_REALITY_SERVER),with_reality_server) \
$(if $(CONFIG_SING_BOX_WITH_SHADOWSOCKSR),with_shadowsocksr) \
$(if $(CONFIG_SING_BOX_WITH_UTLS),with_utls) \
$(if $(CONFIG_SING_BOX_WITH_V2RAY_API),with_v2ray_api) \
$(if $(CONFIG_SING_BOX_WITH_WIREGUARD),with_wireguard) \
))
define Package/$(PKG_NAME)/conffiles
/etc/sing-box/config.json
endef
define Package/$(PKG_NAME)/install
$(call GoPackage/Package/Install/Bin,$(1))
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/sing-box.init $(1)/etc/init.d/sing-box
$(INSTALL_DIR) $(1)/etc/sing-box
$(INSTALL_DATA) ./files/config.json.example $(1)/etc/sing-box/config.json.example
endef
$(eval $(call GoBinPackage,sing-box))
$(eval $(call BuildPackage,sing-box))

View File

@ -1,296 +1,236 @@
{
"log": {
"disabled": false,
"level": "warn",
"output": "/tmp/sing-box.log",
"timestamp": true
},
"experimental": {
"clash_api": {
"external_controller": "0.0.0.0:9090",
"external_ui": "",
"secret": "********",
"default_mode": "rule",
"store_selected": true,
"cache_file": "cache.db"
}
},
"dns": {
"servers": [
{
"tag": "foreign",
"address": "https://1.1.1.1/dns-query"
},
{
"tag": "local",
"address": "tls://1.12.12.12",
"detour": "direct"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
{
"geosite": "category-ads-all",
"server": "block",
"disable_cache": true
},
{
"domain": "mydomain.com",
"geosite": "cn",
"server": "local"
}
],
"strategy": "ipv4_only"
},
"ntp": {
"enabled": false,
"server": "ntp.aliyun.com",
"server_port": 123,
"interval": "30m",
"detour": "direct"
},
"inbounds": [
{
"type": "tun",
"tag": "TUN-in",
"interface_name": "sb-tun0",
"inet4_address": "172.19.0.1/30",
"auto_route": false,
"endpoint_independent_nat": true,
"stack": "system",
"sniff": true
},
{
"type": "mixed",
"tag": "SOCKS-in",
"listen": "::",
"listen_port": *****
},
{
"type": "redirect",
"tag": "REDIRECT-in",
"listen": "::",
"listen_port": *****,
"sniff": true
},
{
"type": "tproxy",
"tag": "TPROXY-in",
"listen": "::",
"listen_port": *****,
"sniff": true
},
{
"type": "direct",
"tag": "DNS-in",
"listen": "::",
"listen_port": *****,
"network": "udp",
"sniff": true
},
{
"type": "shadowsocks",
"tag": "SS-in",
"listen": "::",
"listen_port": *****,
"sniff": true,
"method": "2022-blake3-aes-128-gcm",
"password": "bZzjl2DAXUs02L2Sosgu7A==",
"users": [
{
"name": "User1",
"password": "SGEFjWc+VgNGBXe1JhoRfg=="
},
{
"name": "User2",
"password": "XoXhbj4V9cMXfuUXF/C+cg=="
}
]
}
],
"outbounds": [
{
"type": "selector",
"tag": "Proxy-out",
"outbounds": [
"URL-Test",
"direct",
"Shadowsocks-ShadowTLS-out",
"Trojan-GRPC-out",
"Trojan-WebSocket-out",
"Hysteria-out"
],
"default": "URL-Test"
},
{
"type": "urltest",
"tag": "URL-Test",
"outbounds": [
"Shadowsocks-ShadowTLS-out",
"Trojan-GRPC-out",
"Trojan-WebSocket-out",
"Hysteria-out"
],
"url": "https://cp.cloudflare.com",
"interval": "1m",
"tolerance": 50
},
{
"type": "shadowsocks",
"tag": "Shadowsocks-ShadowTLS-out",
"detour": "Shadowsocks-ShadowTLS",
"method": "2022-blake3-aes-128-gcm",
"password": "F7cx1ASHX/eqQwed+pISzw==:CB8sXcYLzf1P5dUizIzYVg==",
"udp_over_tcp": true,
"multiplex": {
"enabled": false,
"max_connections": 4,
"min_streams": 4,
"max_streams": 0
}
},
{
"type": "shadowtls",
"tag": "Shadowsocks-ShadowTLS",
"server": "***.***.***.***",
"server_port": *****,
"version": 3,
"password": "************",
"tls": {
"enabled": true,
"server_name": "something.example.org",
"utls": {
"enabled": true,
"fingerprint": "chrome"
}
}
},
{
"type": "trojan",
"tag": "Trojan-GRPC-out",
"server": "***.***.***.***",
"server_port": *****,
"password": "************",
"transport": {
"type": "grpc",
"service_name": "************"
},
"tls": {
"enabled": true,
"disable_sni": false,
"server_name": "yours.example.org",
"utls": {
"enabled": true,
"fingerprint": "chrome"
}
}
},
{
"type": "trojan",
"tag": "WebSocket-out",
"server": "***.***.***.***",
"server_port": *****,
"password": "************",
"transport": {
"type": "ws",
"path": "/************",
"early_data_header_name": "Sec-WebSocket-Protocol"
},
"tls": {
"enabled": true,
"disable_sni": false,
"server_name": "yours.example.org",
"utls": {
"enabled": true,
"fingerprint": "chrome"
}
},
"multiplex": {
"enabled": true,
"max_connections": 4,
"min_streams": 4,
"max_streams": 0
}
},
{
"type": "hysteria",
"tag": "Hysteria-out",
"server": "***.***.***.***",
"server_port": *****,
"up_mbps": 100,
"down_mbps": ,
"obfs": "************",
"auth_str": "************",
"tls": {
"enabled": true,
"disable_sni": false,
"server_name": "yours.example.org",
"alpn": [
"h3"
]
}
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"geoip": {
"path": "/tmp/geoip.db",
"download_url": "https://github.com/1715173329/sing-geoip/releases/latest/download/geoip.db",
"download_detour": ""
},
"geosite": {
"path": "/tmp/geosite.db",
"download_url": "https://github.com/1715173329/sing-geosite/releases/latest/download/geosite.db",
"download_detour": ""
},
"rules": [
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"protocol": "quic",
"outbound": "block"
},
{
"geosite": "category-ads-all",
"outbound": "block"
},
{
"geoip": [
"telegram"
],
"outbound": "Trojan-GRPC-out"
},
{
"inbound": [
"SOCKS-in"
],
"outbound": "Proxy-out"
},
{
"geosite": "cn",
"geoip": [
"cn",
"private"
],
"outbound": "direct"
}
],
"auto_detect_interface": true
}
}
{
"log": {
"disabled": false,
"level": "warn",
"output": "/tmp/sing-box.log",
"timestamp": true
},
"experimental": {
"clash_api": {
"external_controller": "0.0.0.0:9090",
"external_ui": "",
"secret": "********",
"direct_io": true,
"default_mode": "rule",
"store_selected": true,
"cache_file": "cache.db"
}
},
"dns": {
"servers": [
{
"tag": "google",
"address": "tls://8.8.8.8"
},
{
"tag": "local",
"address": "tls://1.12.12.12",
"detour": "direct"
}
],
"rules": [
{
"domain": "mydomain.com",
"geosite": "cn",
"server": "local"
}
],
"strategy": "ipv4_only"
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"auto_route": true,
"endpoint_independent_nat": true,
"stack": "system",
"sniff": true
},
{
"type": "mixed",
"tag": "SOCKS-in",
"listen": "::",
"listen_port": *****
},
{
"type": "shadowsocks",
"tag": "SS-in",
"listen": "::",
"listen_port": *****,
"sniff": true,
"method": "2022-blake3-aes-128-gcm",
"password": "bZzjl2DAXUs02L2Sosgu7A==",
"users": [
{
"name": "User1",
"password": "SGEFjWc+VgNGBXe1JhoRfg=="
},
{
"name": "User2",
"password": "XoXhbj4V9cMXfuUXF/C+cg=="
}
]
}
],
"outbounds": [
{
"type": "selector",
"tag": "Proxy-out",
"outbounds": [
"URL-Test",
"direct",
"Shadowsocks-ShadowTLS-out",
"Trojan-GRPC-out",
"Trojan-WebSocket-out",
"Hysteria-out"
],
"default": "URL-Test"
},
{
"type": "urltest",
"tag": "URL-Test",
"outbounds": [
"Shadowsocks-ShadowTLS-out",
"Trojan-GRPC-out",
"Trojan-WebSocket-out",
"Hysteria-out"
],
"url": "http://www.gstatic.com/generate_204",
"interval": "1m",
"tolerance": 50
},
{
"type": "shadowsocks",
"tag": "Shadowsocks-ShadowTLS-out",
"detour": "Shadowsocks-ShadowTLS",
"method": "2022-blake3-aes-128-gcm",
"password": "F7cx1ASHX/eqQwed+pISzw==:CB8sXcYLzf1P5dUizIzYVg==",
"multiplex": {
"enabled": true,
"max_connections": 4,
"min_streams": 4,
"max_streams": 0
}
},
{
"type": "shadowtls",
"tag": "Shadowsocks-ShadowTLS",
"server": "***.***.***.***",
"server_port": *****,
"version": 2,
"password": "************",
"tls": {
"enabled": true,
"server_name": "something.example.org"
}
},
{
"type": "trojan",
"tag": "Trojan-GRPC-out",
"server": "***.***.***.***",
"server_port": *****,
"password": "************",
"transport": {
"type": "grpc",
"service_name": "************"
},
"tls": {
"enabled": true,
"disable_sni": false,
"server_name": "yours.example.org",
"utls": {
"enabled": true,
"fingerprint": "chrome"
}
}
},
{
"type": "trojan",
"tag": "WebSocket-out",
"server": "***.***.***.***",
"server_port": *****,
"password": "************",
"transport": {
"type": "ws",
"path": "/************",
"early_data_header_name": "Sec-WebSocket-Protocol"
},
"tls": {
"enabled": true,
"disable_sni": false,
"server_name": "yours.example.org",
"utls": {
"enabled": true,
"fingerprint": "chrome"
}
},
"multiplex": {
"enabled": true,
"max_connections": 4,
"min_streams": 4,
"max_streams": 0
}
},
{
"type": "hysteria",
"tag": "Hysteria-out",
"server": "***.***.***.***",
"server_port": *****,
"up_mbps": 100,
"down_mbps": ,
"obfs": "************",
"auth_str": "************",
"tls": {
"enabled": true,
"disable_sni": false,
"server_name": "yours.example.org",
"alpn": [
"h3"
]
}
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"rules": [
{
"inbound": [
"SOCKS-in"
],
"outbound": "Proxy-out"
},
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"geosite": "category-ads-all",
"outbound": "block"
},
{
"geosite": "cn",
"geoip": [
"cn",
"private"
],
"outbound": "direct"
},
{
"protocol": "quic",
"outbound": "block"
}
],
"auto_detect_interface": true
}
}

View File

@ -1,54 +1,54 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2022 by nekohasekai <contact-sagernet@sekai.icu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
START=99
USE_PROCD=1
##### ONLY CHANGE THIS BLOCK ######
PROG=/usr/bin/sing-box # where is sing-box
RES_DIR=/etc/sing-box/ # resource dir / working dir / the dir where you store ip/domain lists
CONF=./config.json # where is the config file, it can be a relative path to $RES_DIR
##### ONLY CHANGE THIS BLOCK ######
start_service() {
procd_open_instance
procd_set_param command $PROG run -D $RES_DIR -c $CONF
procd_set_param user root
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 "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
procd_close_instance
iptables -I FORWARD -o sb-tun+ -j ACCEPT
echo "sing-box is started!"
}
stop_service() {
service_stop $PROG
iptables -D FORWARD -o sb-tun+ -j ACCEPT
echo "sing-box is stopped!"
}
reload_service() {
stop
sleep 2s
echo "sing-box is restarted!"
start
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2022 by nekohasekai <contact-sagernet@sekai.icu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
START=99
USE_PROCD=1
##### ONLY CHANGE THIS BLOCK ######
PROG=/usr/bin/sing-box # where is sing-box
RES_DIR=/etc/sing-box/ # resource dir / working dir / the dir where you store ip/domain lists
CONF=./config.json # where is the config file, it can be a relative path to $RES_DIR
##### ONLY CHANGE THIS BLOCK ######
start_service() {
procd_open_instance
procd_set_param command $PROG run -D $RES_DIR -c $CONF
procd_set_param user root
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 "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
procd_close_instance
iptables -I FORWARD -o tun+ -j ACCEPT
echo "sing-box is started!"
}
stop_service() {
service_stop $PROG
iptables -D FORWARD -o tun+ -j ACCEPT
echo "sing-box is stopped!"
}
reload_service() {
stop
sleep 2s
echo "sing-box is restarted!"
start
}