A real-time, high-performance screen sharing solution built with Python Flask and WebSocket technology. Share your screen instantly over local WiFi networks with ultra-low latency and automatic fallback support.
- β‘ Ultra-Low Latency: Real-time screen sharing at up to 60 FPS
- π Offline Operation: Works completely offline on local WiFi networks
- π Smart Fallback: Automatic WebSocket β HTTP polling fallback
- π± Multi-Device Support: Access from any device on the same network
- ποΈ Dynamic Quality Control: Adjustable quality and resolution settings
- π Performance Monitoring: Real-time FPS, latency, and bandwidth stats
- π§ Cross-Platform: Supports Linux, Windows, and macOS
- π‘ Multiple Connection Modes: WebSocket, HTTP streaming, and polling
- Backend: Python Flask + Flask-SocketIO
- Frontend: Vanilla JavaScript with WebSocket support
- Screen Capture: MSS (Multi-Screen Shot) library
- Real-time Communication: Socket.IO with eventlet
- Image Processing: PNG format with base64 encoding
- Python 3.7+
- X11 display server (Linux)
- Local WiFi network
git clone https://github.com/CyberneticsMan/screenshare.git
cd screensharepython -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activatepip install -r requirements.txtpython main.py- Local machine:
http://127.0.0.1:5000 - Other devices:
http://[YOUR_IP]:5000
The server will automatically display your IP address when starting.
Flask==3.0.0
Flask-SocketIO==5.3.6
mss==9.0.1
python-socketio==5.9.0
eventlet==0.33.3
psutil==5.9.6
- Start the server with
python main.py - Note the displayed IP addresses
- Open the URL in any browser on the same network
- Your screen will appear in real-time
- Ultra (95%): Highest quality, more bandwidth
- High (85%): Balanced quality and performance
- Medium (75%): Good quality, lower bandwidth
- Low (60%): Fastest performance, minimal bandwidth
- Full (100%): Original resolution
- High (75%): 3/4 original size
- Medium (50%): Half resolution
- Low (25%): Quarter resolution for maximum speed
Click "Toggle Stats" to view:
- Real-time FPS counter
- Network latency measurements
- Bandwidth usage statistics
- Connected client count
- Frame processing time
Edit the performance settings in main.py:
# High-performance configuration
TARGET_FPS = 60 # Target frames per second
FRAME_INTERVAL = 1.0 / TARGET_FPS
MAX_FRAME_SIZE = 1920 * 1080 // 4
COMPRESSION_QUALITY = 30 # Lower = faster, higher = better quality
SCALE_FACTOR = 0.3 # Frame scaling factorThe server automatically binds to all interfaces (0.0.0.0:5000). To change the port:
socketio.run(app, host='0.0.0.0', port=YOUR_PORT)- Lowest latency
- Real-time bidirectional communication
- Automatic reconnection
- Multipart streaming for continuous frames
- Works when WebSocket fails
- Browser-native support
- JSON API with base64 encoded frames
- Maximum compatibility
- Automatic quality adjustment
- Requires X11 display server
- Automatic
DISPLAYenvironment detection - Multi-monitor support
- Native screen capture support
- Multiple display handling
- No additional configuration needed
- Compatible with Quartz display services
- Retina display support
- Permission handling for screen recording
Black Screen or No Image
- Ensure X11 is running (Linux)
- Check display permissions
- Verify
DISPLAYenvironment variable
High Latency (>1 second)
- Reduce quality settings
- Lower resolution scaling
- Check network bandwidth
- Try different connection modes
Connection Failures
- Verify firewall settings
- Check port 5000 availability
- Ensure devices are on same network
- Try HTTP fallback mode
WebSocket Errors
- The system automatically falls back to HTTP
- Check browser WebSocket support
- Verify Socket.IO library loading
For Maximum Speed:
TARGET_FPS = 30
COMPRESSION_QUALITY = 20
SCALE_FACTOR = 0.25For Best Quality:
TARGET_FPS = 15
COMPRESSION_QUALITY = 85
SCALE_FACTOR = 1.0βββββββββββββββββββ WebSocket/HTTP βββββββββββββββββββ
β Client(s) βββββββββββββββββββββββΊβ Flask Server β
β (Browser) β β β
βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Screen Capture β
β (MSS) β
βββββββββββββββββββ
- Screen Capture Thread: Continuous frame grabbing
- Broadcast Thread: Frame distribution to clients
- WebSocket Handler: Real-time client communication
- HTTP Fallback: Alternative streaming methods
- Performance Monitor: Statistics and optimization
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
CyberneticsMan (Cyber)
- GitHub: @CyberneticsMan
- Audio streaming support
- Multi-user screen sharing
- Recording functionality
- Mobile app support
- Cloud deployment options
- Advanced compression algorithms
- Bandwidth adaptive streaming
If you find this project helpful, please give it a star! β
For issues and feature requests, please use the GitHub Issues page.
Built with β€οΈ for the open-source community