@@ -42,15 +42,19 @@ SHADOWTLS_PORT=9443
4242SHADOWTLS_SNI=" www.microsoft.com"
4343CDN_WS_PORT=2052
4444CDN_WS_PATH=" /cdn-ws"
45+ HTTPUPGRADE_PORT=10443
46+ HTTPUPGRADE_SNI=" www.apple.com"
47+ HTTPUPGRADE_PATH=" /xhttp"
48+ HY2_HOP_RANGE=" 20000:40000"
4549
4650# ─── Step 1: System dependencies ────────────────────────────────────
47- step " 1/9 Installing dependencies"
51+ step " 1/11 Installing dependencies"
4852apt-get update -qq
4953apt-get install -y -qq curl wget sqlite3 jq ufw > /dev/null 2>&1
5054info " Dependencies installed"
5155
5256# ─── Step 2: Swap (if not present) ──────────────────────────────────
53- step " 2/9 Configuring swap"
57+ step " 2/11 Configuring swap"
5458if [[ ! -f /swapfile ]]; then
5559 TOTAL_MEM_MB=$( awk ' /MemTotal/ {print int($2/1024)}' /proc/meminfo)
5660 if [[ $TOTAL_MEM_MB -lt 4096 ]]; then
7175fi
7276
7377# ─── Step 3: Install S-UI ───────────────────────────────────────────
74- step " 3/9 Installing S-UI"
78+ step " 3/11 Installing S-UI"
7579if systemctl is-active --quiet s-ui 2> /dev/null; then
7680 info " S-UI already running, skipping installation"
7781else
@@ -90,7 +94,7 @@ S_UI_DB="/usr/local/s-ui/db/s-ui.db"
9094[[ ! -f " $S_UI_DB " ]] && error " S-UI database not found at $S_UI_DB "
9195
9296# ─── Step 4: Generate Reality keypair & configure inbounds ──────────
93- step " 4/9 Configuring S-UI inbounds"
97+ step " 4/11 Configuring S-UI inbounds"
9498
9599# Generate Reality keypair
96100REALITY_OUTPUT=$( /usr/local/s-ui/sui generate reality-keypair 2> /dev/null || echo " " )
@@ -346,7 +350,7 @@ conn.close()
346350PYEOF
347351
348352# ─── Step 5: Install wireproxy + WARP ───────────────────────────────
349- step " 5/9 Setting up WARP via wireproxy"
353+ step " 5/11 Setting up WARP via wireproxy"
350354
351355# Install wgcf
352356if ! command -v wgcf & > /dev/null; then
440444fi
441445
442446# ─── Step 6: Wire WARP into S-UI ────────────────────────────────────
443- step " 6/9 Connecting S-UI to WARP exit"
447+ step " 6/11 Connecting S-UI to WARP exit"
444448
445449python3 << PYEOF
446450import sqlite3, json
503507fi
504508
505509# ─── Step 7: CDN Relay (VLESS WS) ───────────────────────────────────
506- step " 7/9 Adding CDN relay inbound"
510+ step " 7/11 Adding CDN relay inbound"
507511
508512python3 << PYEOF
509513import sqlite3, json
@@ -548,7 +552,7 @@ info "CDN relay inbound ready on port ${CDN_WS_PORT}"
548552info " To enable: add CF DNS A record pointing to ${SERVER_IP} (Proxied)"
549553
550554# ─── Step 8: ShadowTLS v3 ───────────────────────────────────────────
551- step " 8/9 Setting up ShadowTLS v3"
555+ step " 8/11 Setting up ShadowTLS v3"
552556
553557# Install standalone sing-box for ShadowTLS
554558if ! command -v sing-box & > /dev/null; then
@@ -620,8 +624,55 @@ else
620624 warn " ShadowTLS may need a moment to start"
621625fi
622626
623- # ─── Step 9: Firewall ───────────────────────────────────────────────
624- step " 9/9 Configuring firewall"
627+ # ─── Step 9: VLESS HTTPUpgrade (stealth HTTP transport) ─────────────
628+ step " 9/11 Adding VLESS HTTPUpgrade"
629+
630+ # Add HTTPUpgrade inbound to the standalone sing-box config
631+ python3 << PYEOF
632+ import json
633+ with open("/etc/suiwarp/shadowtls.json") as f: cfg = json.load(f)
634+ # Check if already added
635+ tags = [ib["tag"] for ib in cfg["inbounds"]]
636+ if "vless-httpupgrade-in" not in tags:
637+ cfg["inbounds"].append({
638+ "type": "vless", "tag": "vless-httpupgrade-in",
639+ "listen": "::", "listen_port": ${HTTPUPGRADE_PORT} ,
640+ "users": [{"uuid": "${UUID} ", "flow": ""}],
641+ "tls": {"enabled": True, "server_name": "${HTTPUPGRADE_SNI} ",
642+ "reality": {"enabled": True,
643+ "handshake": {"server": "${HTTPUPGRADE_SNI} ", "server_port": 443},
644+ "private_key": "${PRIVATE_KEY:- } ",
645+ "short_id": ["${SHORT_ID} ", ""]}},
646+ "transport": {"type": "httpupgrade", "path": "${HTTPUPGRADE_PATH} ", "host": "${HTTPUPGRADE_SNI} "}
647+ })
648+ with open("/etc/suiwarp/shadowtls.json", "w") as f: json.dump(cfg, f, indent=2)
649+ print("Added HTTPUpgrade inbound")
650+ else:
651+ print("HTTPUpgrade already configured")
652+ PYEOF
653+
654+ systemctl restart suiwarp-shadowtls
655+ sleep 2
656+ info " VLESS HTTPUpgrade on port ${HTTPUPGRADE_PORT} "
657+
658+ # ─── Step 10: Hysteria2 Port Hopping ────────────────────────────────
659+ step " 10/11 Configuring Hysteria2 port hopping"
660+
661+ # DNAT UDP port range to Hysteria2 port
662+ IFACE=$( ip route show default | awk ' {print $5}' | head -1)
663+ if ! iptables -t nat -L PREROUTING -n 2> /dev/null | grep -q " 8443" ; then
664+ iptables -t nat -A PREROUTING -i " $IFACE " -p udp --dport ${HY2_HOP_RANGE} -j DNAT --to-destination :8443
665+ ip6tables -t nat -A PREROUTING -i " $IFACE " -p udp --dport ${HY2_HOP_RANGE} -j DNAT --to-destination :8443 2> /dev/null
666+ mkdir -p /etc/iptables
667+ iptables-save > /etc/iptables/rules.v4 2> /dev/null
668+ ip6tables-save > /etc/iptables/rules.v6 2> /dev/null
669+ info " Hysteria2 port hopping: UDP ${HY2_HOP_RANGE} → 8443"
670+ else
671+ info " Port hopping DNAT already configured"
672+ fi
673+
674+ # ─── Step 11: Firewall ──────────────────────────────────────────────
675+ step " 11/11 Configuring firewall"
625676
626677# Detect SSH port
627678SSH_PORT=$( ss -tlnp | grep sshd | awk ' {print $4}' | grep -oP ' \d+$' | head -1)
@@ -640,6 +691,8 @@ ufw allow 8880/tcp comment "Trojan-Reality" > /dev/null 2>&1
640691ufw allow 2083/tcp comment " VLESS-Reality-WS" > /dev/null 2>&1
641692ufw allow 2052/tcp comment " VLESS-CDN-WS" > /dev/null 2>&1
642693ufw allow 9443/tcp comment " ShadowTLS-v3" > /dev/null 2>&1
694+ ufw allow 10443/tcp comment " VLESS-HTTPUpgrade" > /dev/null 2>&1
695+ ufw allow 20000:40000/udp comment " Hysteria2-PortHop" > /dev/null 2>&1
643696ufw allow 2095/tcp comment " S-UI-Panel" > /dev/null 2>&1
644697ufw allow 2096/tcp comment " S-UI-Sub" > /dev/null 2>&1
645698
@@ -693,6 +746,8 @@ ${BOLD}│${NC} 5. Trojan Reality :8880/tcp ${BOLD}│
693746${BOLD} │${NC} 6. VLESS Reality WS :2083/tcp ${BOLD} │${NC}
694747${BOLD} │${NC} 7. VLESS CDN WS :2052/tcp (CF relay) ${BOLD} │${NC}
695748${BOLD} │${NC} 8. ShadowTLS v3 + SS2022 :9443/tcp (anti-DPI) ${BOLD} │${NC}
749+ ${BOLD} │${NC} 9. VLESS HTTPUpgrade :10443/tcp (stealth) ${BOLD} │${NC}
750+ ${BOLD} │${NC} 10. Hysteria2 PortHop :20000-40000/udp ${BOLD} │${NC}
696751${BOLD} │${NC} ${BOLD} │${NC}
697752${BOLD} │${NC} Client links: ${YELLOW} /root/suiwarp-client-links.txt${NC}
698753${BOLD} │${NC} ShadowTLS: ${YELLOW} /root/suiwarp-extra-links.txt${NC}
0 commit comments