Files
ProxyPool/script/stop.bat
祀梦 abb8b32ed3 fix: 更换前端端口 9948 -> 18081 解决 Windows 权限问题
- 前端端口改为 18081
- 添加 host: 127.0.0.1 配置
- 更新 CORS 允许新前端地址
- 更新启动/停止脚本
2026-04-04 13:38:08 +08:00

41 lines
1.2 KiB
Batchfile

@echo off
chcp 65001 >nul
echo === Stopping ProxyPool Services ===
echo.
set "BACKEND_PORT=18080"
set "FRONTEND_PORT=18081"
set "STOPPED_COUNT=0"
echo [1/2] Stopping processes on ports %BACKEND_PORT% and %FRONTEND_PORT%...
REM Stop backend port
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":%BACKEND_PORT%" ^| findstr "LISTENING"') do (
for /f "tokens=1" %%b in ('tasklist /FI "PID eq %%a" ^| findstr "%%a"') do (
taskkill /F /PID %%a >nul 2>&1
echo Stopped port %BACKEND_PORT% (PID: %%a, Process: %%b)
set /a STOPPED_COUNT+=1
)
)
REM Stop frontend port
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":%FRONTEND_PORT%" ^| findstr "LISTENING"') do (
for /f "tokens=1" %%b in ('tasklist /FI "PID eq %%a" ^| findstr "%%a"') do (
taskkill /F /PID %%a >nul 2>&1
echo Stopped port %FRONTEND_PORT% (PID: %%a, Process: %%b)
set /a STOPPED_COUNT+=1
)
)
echo Stopped %STOPPED_COUNT% process(es)
echo.
echo [2/2] Waiting for processes to fully stop...
REM Use ping instead of timeout for PowerShell compatibility
ping -n 3 127.0.0.1 >nul 2>&1
echo.
echo === Done ===
echo All services have been stopped.
echo.