Guide to access the Hacker League web app from other devices on your network (like your phone).
Windows:
ipconfigLook for "IPv4 Address" under your active network adapter (usually "Wireless LAN adapter Wi-Fi")
Example output:
Wireless LAN adapter Wi-Fi:
IPv4 Address. . . . . . . . . . . : 10.160.158.173
Mac/Linux:
ifconfig
# or
ip addr showEdit src/config/api.config.js:
// Change this line:
const HOST = 'localhost';
// To your PC's IP:
const HOST = '10.160.158.173';Create a .env file in the HS-WebApp folder:
HOST=0.0.0.0Or copy from example:
cp .env.example .env
# Then uncomment the HOST lineOption A: Add firewall rules (recommended)
# Allow React dev server (port 3000)
netsh advfirewall firewall add rule name="React Dev Server" dir=in action=allow protocol=TCP localport=3000
# Allow Flask API (port 8080)
netsh advfirewall firewall add rule name="Flask API" dir=in action=allow protocol=TCP localport=8080
# Allow Node backend (port 5000)
netsh advfirewall firewall add rule name="Node Backend" dir=in action=allow protocol=TCP localport=5000Option B: Temporarily disable firewall (not recommended)
netsh advfirewall set allprofiles state off# Start Flask API (HS-API)
cd path/to/HS-API
flask run --host=0.0.0.0 --port 8080
# Start Node backend
cd HS-WebApp/backend
npm start
# Start React frontend
cd HS-WebApp
npm startMake sure your phone is on the same Wi-Fi network, then open:
http://10.160.158.173:3000
Replace 10.160.158.173 with your actual IP address.
-
Check both devices are on same network:
- PC:
ipconfig(Windows) orifconfig(Mac/Linux) - Phone: Settings → Wi-Fi → Check connected network
- PC:
-
Test connectivity:
# From your phone's browser: http://YOUR_PC_IP:8080/health -
Verify firewall rules:
netsh advfirewall firewall show rule name=all | findstr "3000 8080 5000"
-
Check if ports are listening:
netstat -an | findstr "3000 8080 5000"
- Make sure you updated
src/config/api.config.jswith your IP - Verify Flask API is running with
--host=0.0.0.0 - Check firewall allows port 8080
- Node backend must be running
- Firewall must allow port 5000
- Check browser console for WebSocket errors
Instead of editing api.config.js, you can use environment variables:
Create .env file:
REACT_APP_API_URL=http://10.160.158.173:8080
REACT_APP_BACKEND_URL=http://10.160.158.173:5000/api
REACT_APP_WS_URL=ws://10.160.158.173:5000
HOST=0.0.0.0This overrides the defaults without changing code!
- Remember to change back to
localhostfor normal development - Firewall rules persist after reboot
- Environment variables only work if set before
npm start .envfiles are gitignored (won't be committed)
- Only allow network access on trusted networks
- Don't expose these ports on public networks
- Re-enable firewall after testing
- Use HTTPS/WSS in production