44 lines
974 B
Batchfile
44 lines
974 B
Batchfile
@echo off
|
|
REM Set console to UTF-8 encoding to prevent garbled text on Chinese Windows systems
|
|
chcp 65001 >nul 2>&1
|
|
echo Testing MITM Proxy Server...
|
|
echo.
|
|
|
|
REM Check Go environment
|
|
go version >nul 2>&1
|
|
if %errorLevel% neq 0 (
|
|
echo Error: Go environment not found, please install Go language
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Go environment check passed
|
|
|
|
REM Check configuration file
|
|
if not exist "config.toml" (
|
|
echo Error: config.toml configuration file not found
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Configuration file check passed
|
|
|
|
REM Attempt to compile program
|
|
echo Compiling program...
|
|
go build -o mitm_test.exe .
|
|
if %errorLevel% neq 0 (
|
|
echo Compilation failed! Please check code for errors
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
echo Compilation successful!
|
|
|
|
REM Clean up test file
|
|
if exist "mitm_test.exe" del "mitm_test.exe"
|
|
|
|
echo.
|
|
echo All tests passed! The program can run normally.
|
|
echo Use run.bat to start the program (requires administrator privileges)
|
|
echo.
|
|
pause |