Files
ProxyPool/script/stop.bat
祀梦 eeb16774d7 fix: 更换后端端口 9949 -> 18080 解决 Windows 绑定权限问题
- 修改后端默认端口为 18080
- 更新前端 API 配置支持新端口
- 更新启动/停止脚本端口配置
- 添加 .env 配置文件
2026-04-04 13:37:17 +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=9948"
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.