外網用戶 → 公網IP:8181 → 路由器 (NAT/埠映射 8181→192.168.x.x:8181) → 本地伺服器:8181
https://127.0.0.1:8181 或 https://192.168.x.x:8181 確認服務正常。# Windows
netsh advfirewall firewall add rule name="Web8181" dir=in action=allow protocol=TCP localport=8181
# Linux
firewall-cmd --permanent --add-port=8181/tcp && firewall-cmd --reload
# 外網機器測試
curl -v https://公網IP:8181
telnet 公網IP 8181
nmap -p 8181 公網IP
外網無法訪問依序排查:本地服務正常 → 路由器埠映射正確 → 伺服器防火牆放行 → 公網 IP 可達(非 CGNAT)→ ISP 未封鎖埠。若為大內網環境,必須使用內網穿透工具(frp、ngrok、ZeroTier)。