-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_web_server.bat
More file actions
72 lines (59 loc) · 1.8 KB
/
Copy pathrun_web_server.bat
File metadata and controls
72 lines (59 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@echo off
cd /d "%~dp0"
echo.
echo VoxAI Web Server - Remote Access
echo =================================
echo.
:: ============================================
:: CONFIGURATION - EDIT THESE
:: ============================================
:: Port to run on (make sure to port forward this on your router)
set "SERVER_PORT=7860"
:: Password for access (CHANGE THIS!)
set "SERVER_PASSWORD=voxai2024"
:: Bind to all interfaces (0.0.0.0) to allow remote access
set "SERVER_HOST=0.0.0.0"
:: ============================================
:: DISPLAY INFO
:: ============================================
:: Get local IP
for /f "tokens=2 delims=:" %%a in ('ipconfig ^| findstr /c:"IPv4"') do (
for /f "tokens=1" %%b in ("%%a") do (
set "LOCAL_IP=%%b"
goto :found_ip
)
)
:found_ip
echo Local URL: http://localhost:%SERVER_PORT%
echo Network URL: http://%LOCAL_IP%:%SERVER_PORT%
echo Port: %SERVER_PORT%
echo Password: %SERVER_PASSWORD%
echo.
echo To access from outside your network:
echo 1. Port forward %SERVER_PORT% on your router
echo 2. Use your public IP (google "what is my ip")
echo.
echo Or use Tailscale/Cloudflare Tunnel for secure access
echo.
echo =================================
echo.
:: ============================================
:: ACTIVATE VENV AND RUN
:: ============================================
if exist "venv\Scripts\activate.bat" (
call venv\Scripts\activate.bat
) else (
echo [ERROR] Virtual environment not found!
echo Please create it first: python -m venv venv
pause
exit /b 1
)
:: Install Flask if needed
pip show flask >nul 2>&1
if errorlevel 1 (
echo Installing Flask...
pip install flask flask-cors --quiet
)
:: Run the server
python web_server.py --host %SERVER_HOST% --port %SERVER_PORT% --password "%SERVER_PASSWORD%"
pause