1.9 KiB
1.9 KiB
Windows Print Service Network Configuration Guide
Current Issue
Your Flask server (Linux) cannot connect to Windows Print Service because they're on different machines.
Solution Options
Option 1: Same Machine Setup
If both Flask and Windows service are on the same machine:
WINDOWS_PRINT_SERVICE_URL = "http://localhost:8765"
Option 2: Different Machines (Recommended)
If Flask server (Linux) and Windows service are on different machines:
-
Find Windows Machine IP Address:
# On Windows machine, run: ipconfig # Look for IPv4 Address, e.g., 192.168.1.100 -
Update Configuration:
# In /app/print_config.py, change: WINDOWS_PRINT_SERVICE_URL = "http://192.168.1.100:8765" -
Test Connection:
# From Linux machine, test: curl http://192.168.1.100:8765/health
Option 3: Windows Firewall Configuration
Ensure Windows allows incoming connections on port 8765:
-
Windows Firewall Settings:
- Control Panel → System and Security → Windows Defender Firewall
- Advanced Settings → Inbound Rules → New Rule
- Port → TCP → 8765 → Allow the connection
-
Test from Linux:
telnet [WINDOWS_IP] 8765
Option 4: Port Forwarding/Tunneling
If direct connection isn't possible, set up SSH tunnel or port forwarding.
Quick Fix for Testing
- Get Windows IP Address
- Update print_config.py with the IP
- Restart Flask server
- Test printing
Current Status
- ✅ Windows Print Service: Running (localhost:8765/health works)
- ❌ Network Connection: Flask can't reach Windows service
- 🔧 Fix Needed: Update WINDOWS_PRINT_SERVICE_URL with correct IP
Example Commands
# 1. Find Windows IP (run on Windows):
# ipconfig | findstr IPv4
# 2. Test connection (run on Linux):
# curl http://[WINDOWS_IP]:8765/health
# 3. Update config and restart Flask