Files
umbrix-libcore/docker/hiddify.sh

41 lines
1.3 KiB
Bash
Raw Normal View History

2024-03-14 23:44:36 +01:00
#!/bin/sh
2024-03-15 09:33:57 +01:00
# sysctl -w net.ipv4.ip_forward=1
# sysctl -w net.ipv6.ip_forward=1
# ip rule add fwmark 1 table 100 ;
# ip route add local 0.0.0.0/0 dev lo table 100
# # CREATE TABLE
# iptables -t mangle -N hiddify
# # RETURN LOCAL AND LANS
# iptables -t mangle -A OUTPUT -j RETURN
# iptables -t nat -A hiddify --dport 2334 -j RETURN
# iptables -t mangle -A hiddify -d 10.0.0.0/8 -j RETURN
# iptables -t mangle -A hiddify -d 127.0.0.0/8 -j RETURN
# iptables -t mangle -A hiddify -d 169.254.0.0/16 -j RETURN
# iptables -t mangle -A hiddify -d 172.16.0.0/12 -j RETURN
# iptables -t mangle -A hiddify -d 192.168.50.0/16 -j RETURN
# iptables -t mangle -A hiddify -d 192.168.9.0/16 -j RETURN
# iptables -t mangle -A hiddify -d 224.0.0.0/4 -j RETURN
# iptables -t mangle -A hiddify -d 240.0.0.0/4 -j RETURN
# iptables -t mangle -A hiddify -p udp -j TPROXY --on-port 2334 --tproxy-mark 1
# iptables -t mangle -A hiddify -p tcp -j TPROXY --on-port 2334 --tproxy-mark 1
# # HIJACK ICMP (untested)
# # iptables -t mangle -A hiddify -p icmp -j DNAT --to-destination 127.0.0.1
# # REDIRECT
# iptables -t mangle -A PREROUTING -j hiddify
2024-08-21 00:33:59 +03:30
if [ -f "/hiddify/hiddify.json" ]; then
/hiddify/HiddifyCli run --config "$CONFIG" -d /hiddify/hiddify.json
2024-03-14 23:44:36 +01:00
else
/hiddify/HiddifyCli run --config "$CONFIG"
fi
2024-03-15 09:33:57 +01:00