A Python-based screen sharing application with security code authentication and advanced web viewing features. Share your screen securely with others in real-time with professional quality!
⬇️ Download Ready-to-Use EXE File: 📥 Download Latest Release
- 🚀 No Python Required - Just download and run!
- 📦 Portable - No installation needed
- 🔒 Safe - Windows Defender may show warning (false positive)
- 💾 Size - ~85-100 MB optimized build
Real-time screen sharing with modern web interface, mobile-friendly design, and professional quality streaming
- 🔒 Secure Connection: Random security code generation + manual approval system
- 📺 Real-time Streaming: Live screen capture and streaming at high quality
- 🚀 Easy to Use: Simple menu-driven interface
- 🔌 Network Support: Works over LAN, localhost, and internet (with Cloudflare Tunnel/ngrok)
- 🌐 Remote Access: Share screen across different networks/locations
- 👥 Multiple Viewers: Support for unlimited simultaneous viewers
- 🎯 Unified Launcher: Single entry point with menu options
- 🖱️ Cursor Visibility: See the presenter's mouse cursor in real-time
- 📱 Mobile Friendly: Responsive design works on phones, tablets, and desktops
- 🖼️ High Quality: 100% resolution at 95% JPEG quality for crystal-clear viewing
- 🔍 Interactive Zoom: Click to zoom into any section, drag to pan around
- 🎬 Fullscreen Mode: Immersive viewing with draggable controls
- ⌨️ Keyboard Shortcuts: F key for fullscreen, Esc to exit
- 🎨 Modern UI: Clean, professional interface with individual digit input boxes
- 📢 Toast Notifications: Real-time status updates for all events
- 🔌 Connection Monitoring: Automatic disconnection detection
- ⚡ Smooth Performance: 20 FPS streaming with optimized JPEG encoding
- 🎮 Touch Support: Full touch gesture support for mobile devices
- 🎚️ Interactive Quality Button: Click to adjust quality anytime during viewing
- 📊 Three Quality Levels: HIGH (best), MEDIUM (balanced), LOW (fast)
- 🔄 Real-Time Switching: Change quality instantly without reconnection
- 🎨 Visual Dropdown Menu: Intuitive GUI in top-right corner of viewer
- 🌐 Adaptive Streaming: Adjust quality based on your network speed
- 💾 Smart Defaults: Starts at MEDIUM quality, perfect for most users
- ⚡ Client-Side Scaling: Server sends high quality, client scales as needed
- 📱 Responsive Window: Fully resizable viewer with quality overlay
- 📌 System Tray Icon: Minimalist icon in your taskbar notification area
- 🎛️ Quick Menu Access: Right-click icon for instant menu access
- 👁️ Hide/Show Window: Toggle console window visibility on-the-fly
- 🔄 Restart Application: Quick restart without closing
- 🌐 Developer Link: Direct access to developer's website
- 🐙 Contribute Link: Quick link to GitHub repository for reporting issues
- ❌ Clean Exit: Proper shutdown with no errors or hanging processes
- 🔐 Two-Factor Security: Security code + manual server approval
- 🛡️ Session Management: Unique session IDs for each connection
- 📋 Queue System: Sequential approval processing for multiple requests
- 🚫 Thread-Safe: Race condition prevention with proper locking
- ✅ Python 3.7 or higher
- ✅ OS: Windows 10|11/Linux/macOS (64-bit)
- ✅ RAM: 4 GB minimum
- ✅ Disk: 100 MB free space
- ✅ Network: Local network or internet connection
- ✅ Python: NOT REQUIRED! (Built-in)
-
Clone or download this repository
-
Install required packages:
pip install -r requirements.txt
Simply run the main application and choose what you want to do:
python main.pyYou'll see a menu with eight options:
============================================================
SCREEN SHARING APPLICATION
============================================================
Choose an option:
[1] Share My Screen (Desktop App)
[2] View Someone's Screen (Desktop App)
[3] Share My Screen (Web Browser - Mobile Friendly)
[4] Start Cloudflare Tunnel (Unlimited Bandwidth)
[5] Share My Screen via Cloudflare Tunnel (Merged)
[6] Share My Screen (Trusted Mode - No Security Code)
[7] Share My Screen Trusted Mode via Cloudflare Tunnel (Merged)
[8] Exit
------------------------------------------------------------
Enter your choice (1-8):
This option works under both user is connected under same wifi
- Select option 1 from the menu
- Your screen will be captured and displayed in a new desktop window
- A security code will be generated and displayed (e.g.,
ABC123) - Note the server details for viewers to connect (e.g., SERVER IP:
10.5.234.63) - Viewers can connect using Option 2 (desktop app) with the security code
- Press
Qkey orESCto stop sharing and return to menu
Benefits:
- ✅ Desktop-to-desktop connection
- ✅ Direct screen capture display
- ✅ High quality streaming
- ✅ Secure (code-protected)
- ✅ High performance for local networks
Example Output:
🖥️ SHARE MY SCREEN MODE
============================================================
[*] Press Ctrl+C to stop sharing
============================================================
🔐 SECURITY CODE: XMP7MG
📡 SERVER IP: 10.5.234.63
🔌 PORT: 5555
============================================================
📤 Share this information with the viewer:
IP Address: 10.5.234.63
Security Code: XMP7MG
============================================================
[*] Server listening on 0.0.0.0:5555
[*] Starting optimized screen capture loop...
[*] Waiting for connections...
[*] Starting optimized capture loop for multi-user performance
- Select option 2 from the menu
- Enter the required information when prompted:
- Server IP address:
- Use
localhostor127.0.0.1if viewing on the same PC - Use the actual IP address if connecting from another PC (e.g.,
192.168.1.100)
- Use
- Port: Press Enter for default (5555) or enter custom port
- Security code: Enter the 6-character code provided by the person sharing
- Server IP address:
- Wait for server approval
- If approved, you'll see the shared screen in a new desktop window
- Press
Qkey orESCto quit viewing and return to the menu
Example:
👀 VIEW SOMEONE'S SCREEN MODE
============================================================
Enter server IP address (or 'localhost' for same PC): localhost
Enter server port (default: 5555):
Enter the security code: XGFRDW
------------------------------------------------------------
[+] Successfully connected to server!
[*] Receiving screen feed...
[*] Press 'q' to quit
Perfect for viewing on mobile phones, tablets, or any device with a browser under same wifi!
-
Select option 2 from the menu
-
A security code will be generated and displayed
-
Press C to copy the security code to clipboard, or any other key to skip:
-
The application will show URLs to access the screen share:
Access the screen share from your browser at: http://192.168.1.100:5000 http://localhost:5000 -
On your mobile phone or any device:
- Make sure it's connected to the same WiFi network as your PC
- Open a web browser (Chrome, Safari, Firefox, etc.)
- Enter the URL shown (e.g.,
http://192.168.1.100:5000) - Enter the security code in individual digit boxes (auto-focus, paste support)
- Wait for server approval
- View the screen in real-time with high quality!
-
Press
Ctrl+Con the server to stop sharing -
For sharing screen over the internet sharing open new terminal and choose option 4
Web Browser Features:
- ✅ Responsive Design: Works perfectly on any screen size
- ✅ Touch-Friendly Interface: Optimized for mobile gestures
- ✅ No App Installation: Just open a browser
- ✅ High Quality: 100% resolution at 95% JPEG quality
- ✅ Interactive Zoom:
- Click anywhere to zoom into that section
- Drag to pan when zoomed in
- Click again to zoom out
- ✅ Fullscreen Mode:
- Double-click the F button to enter fullscreen
- Drag the F button anywhere on screen
- Press F key or Esc key to exit
- Double-click F button again to exit
- ✅ Keyboard Shortcuts:
Fkey → Toggle fullscreen modeEsckey → Exit fullscreen mode
- ✅ Individual Digit Boxes: Easy code entry with paste support
- ✅ Toast Notifications: Real-time status updates
- ✅ Connection Monitoring: Auto-detects server disconnection
- ✅ Smooth Streaming: 20 FPS for fluid motion
- ✅ Multi-User Support: Unlimited simultaneous viewers
- ✅ Cross-Platform: Works on iOS, Android, Windows, macOS, Linux
Example Output:
🌐 WEB BROWSER SCREEN SHARE MODE
============================================================
============================================================
SECURITY CODE: XK9M2P
============================================================
Share this code with the person who wants to view your screen
Multiple viewers can connect simultaneously!
============================================================
[*] Access the screen share from your browser at:
http://192.168.1.100:8080
http://localhost:8080
[*] Server starting on 0.0.0.0:8080
[*] Multi-user support enabled
[*] Approval processor started - requests will be handled sequentially
[*] Press Ctrl+C to stop sharing
Share your screen over the internet using Cloudflare tunnels for web browser access
- Select option 4 from the menu
- Choose option 1 for Quick Tunnels (Recommended)
- Choose option 1 for Web Mode
- Cloudflare tunnel will start automatically
- You'll receive a public URL (e.g.,
https://random-name.trycloudflare.com) - This establishes the tunnel infrastructure for screen sharing
- Share this URL with anyone worldwide!
- They can access your screen through their web browser
- Use this in combination with other options for internet access (Option 3 & 6)
- Press Ctrl+C to stop the tunnel
Example:
🌐 CLOUDFLARE TUNNEL
============================================================
[*] Starting Cloudflare tunnel...
[*] Tunnel URL: https://quick-fox-123.trycloudflare.com
[*] Tunnel established successfully
[*] Ready for screen sharing over internet
[*] Press Ctrl+C to stop tunnel
Benefits:
- ✅ Share over internet (not just LAN)
- ✅ No port forwarding needed
- ✅ Unlimited bandwidth
- ✅ Works from anywhere
- ✅ Mobile-friendly
- Select option 5 from the menu
- This combines screen sharing with Cloudflare tunnel in one step
- You'll receive both a security code and public URL
- Cloudflare public URL will be automatically copied to clipboard
- Press c to copy the security code to clipboard
- Share both URL and code with viewer
- They can access from anywhere with internet
- Security code still required for approval
- Press Ctrl+C to stop sharing
Example:
🌐 CLOUDFLARE TUNNEL + SCREEN SHARE (MERGED)
============================================================
[*] 🚀 Starting Cloudflare Tunnel...
[*] 🌐 Public URL: https://bright-star-456.trycloudflare.com
[*] Security code: ABCD12
[*] Share both URL and code with viewer
[*] Press Ctrl+C to stop sharing
Benefits:
- ✅ Direct TCP connection
- ✅ Lower latency than HTTP
- ✅ Internet access via Cloudflare
- ✅ No bandwidth limits
Share your screen without requiring security codes - perfect for trusted environments. (under same wifi)
- Select option 6 from the menu
- Your screen starts sharing immediately without security code
- The server shows your IP address (e.g.,
192.168.1.100:8080) - Anyone on your network can connect by entering the IP in their browser
- Use only in trusted environments (home network, trusted colleagues)
- Quality controls (High/Medium/Low) work the same way
- Press Ctrl+C to stop sharing
⚠️ Security Note: Only use in trusted environments!
Example:
🔓 TRUSTED MODE (NO SECURITY CODE)
============================================================
[*] Server starting on 0.0.0.0:8080
[*] Trusted mode - no approval required
[*] Connect with: http://192.168.1.100:8080
[*] Press Ctrl+C to stop sharing
Benefits:
- ✅ No security code hassle
- ✅ Instant access for trusted users
- ✅ Perfect for family/team sharing
- ✅ Same high-quality streaming
Combines Cloudflare internet access with trusted mode for the easiest possible sharing. (worldwide access)
- Select option 7 from the menu
- Combines Cloudflare tunnel with trusted mode
- You'll receive a public URL that anyone can access directly
- URL will be copied automatically to clipboard
- No approval needed - immediate access for anyone with the link
- Use with extreme caution - only for very trusted recipients
- Press Ctrl+C to stop sharing
⚠️ Security Note: URL access grants immediate screen viewing!
Example:
🌐 CLOUDFLARE + TRUSTED MODE
============================================================
[*] Starting Cloudflare tunnel...
[*] Public URL: https://red-moon-789.trycloudflare.com
[*] TRUSTED MODE: No security code required
[*] Anyone with this URL has immediate access
[*] Press Ctrl+C to stop sharing
Benefits:
- ✅ Internet access via Cloudflare
- ✅ No security codes needed
- ✅ Easiest sharing method
- ✅ Perfect for demonstrations
Safely close the application. Closes the application with confirmation.
- ✅ Use the same WiFi network
- ✅ Use landscape mode for better viewing
- ✅ Double-click F button or use F key for fullscreen
- ✅ Click on any area to zoom in, drag to pan
- ✅ Stable connection = smoother streaming
- ✅ Close unnecessary apps on phone for better performance
- ✅ Use paste functionality for quick code entry (long-press in code box)
Zoom Features:
- Click to Zoom: Click anywhere on the screen to zoom into that exact section
- Drag to Pan: When zoomed, drag with mouse/finger to move around
- Click to Zoom Out: Click again to return to fit-to-screen view
Fullscreen Features:
- Enter Fullscreen:
- Double-click the F button in header
- OR press F key on keyboard
- Exit Fullscreen:
- Press Esc key
- OR press F key again
- OR double-click the draggable F button
- Move F Button: Drag the F button to any position when in fullscreen
Keyboard Shortcuts:
F→ Toggle fullscreen mode (when viewing screen)Esc→ Exit fullscreen mode (when in fullscreen)
For the simplest internet sharing experience:
Single Step:
Run ScreenShare.exe
Choose [7] (Cloudflare + Trusted)
Share the URL - that's it!
For secure internet sharing with authentication:
Two Steps:
1. Run ScreenShare.exe
2. Choose [5] (Cloudflare HTTP)
3. Share URL and security code
All sharing modes work great on mobile!
Perfect for:
- ✅ Phones
- ✅ Tablets
- ✅ Any device with browser
Best options for mobile:
- Option [5] (regular mode)
- Option [6] (trusted mode - no code needed)
- Option [7] (Cloudflare + trusted for internet)
Test everything works:
- Run ScreenShare.exe
- Choose [3] (Share My Screen)
- Open browser
- Go to
http://localhost:5000 - Enter security code
- Should see your screen!
Test trusted mode:
- Run ScreenShare.exe
- Choose [6] (Trusted Mode)
- Open browser
- Go to
http://localhost:5000 - No code needed - instant access!
Want to share to multiple viewers?
All modes support multiple viewers:
- ✅ Multiple viewers can connect simultaneously
- ✅ Each enters same security code (except trusted mode)
- ✅ All see your screen
Recommendation:
- Use trusted mode (option [5]) for easy multiple access
- Use Cloudflare + trusted (option [7]) for internet sharing to multiple people
By default, screen sharing only works when both users are on the same WiFi/local network. But what if you want to share with someone in a different location?
- Choose option 5 (for secure connection)
- Choose option 7 (for trusted user)
- We are using Cloudflare for remote access
Why Cloudflare? Superior Choice:
- 🌐 No Bandwidth Limits (ngrok has monthly limits)
- ⚡ Enterprise Performance (Cloudflare's global CDN)
- 👥 Multiple Users (perfect for multi-user optimization)
- 🆓 Completely Free (no subscription required)
- 🔒 More Secure (enterprise-grade infrastructure)
- 💰 No Monthly Fees (completely free)
# Just use options 1 & 2 or 3 directly
python main.py → 1 # Server
python main.py → 2 # Client
python main.py → 3 # Server# Use Cloudflare Tunnel (Recommended)
python main.py → 5/7 # Server or 👇
python cloudflare_helper.py # Setup tunnel first
python main.py → 3 # Server (use tunnel URL)Yes, your application supports cross-location screen sharing! 🎉
The Cloudflare Tunnel integration provides unlimited bandwidth and better performance for multiple users.
| Scenario | Server Steps | Client Steps |
|---|---|---|
| Same WiFi | main.py → 1 |
main.py → 2 |
| Same WiFi | main.py → 3 |
URL & Security Code |
| Different WiFi (Cloudflare) | main.py → 5/7 |
URL & Security Code |
| Different WiFi (Cloudflare) | cloudflare_helper.py |
Use Cloudflare URL |
You can also run the server and client directly if you prefer:
python server.pypython client.py- Server IP:
localhostor127.0.0.1 - No firewall configuration needed
-
Find the server PC's IP address:
- Windows: Open Command Prompt and type
ipconfig - Linux/Mac: Open Terminal and type
ifconfigorip addr - Look for the IPv4 address (e.g.,
192.168.1.100)
- Windows: Open Command Prompt and type
-
Configure Firewall (if needed):
- Allow incoming connections on port 5555 (Desktop) or 8080 (Web)
- Windows Firewall:
- Open Windows Defender Firewall
- Click "Advanced settings"
- Create new Inbound Rule for port 5555 and/or 8080
-
Connect:
- Desktop Client: Enter the server's IP address when prompted
- Web Browser: Navigate to
http://SERVER_IP:8080
You can customize the following settings by editing the source code:
- Main entry point for the application
- Handles user interface and navigation
- Imports and runs server, web server, or client based on user choice
- Port: Change
port=5555in theScreenShareServerinitialization - Code Length: Change
length=6ingenerate_security_code()method - Image Quality: Adjust
scale_percent(around line 58) and JPEG quality (around line 64)- Lower values = better performance, lower quality
- Higher values = worse performance, better quality
- Port: Change
port=8080in theScreenShareWebServerinitialization - Code Length: Change
length=6ingenerate_security_code()method - Image Quality:
- Adjust
scale_percent(currently 100% for maximum quality) incapture_screen_loop() - Adjust JPEG quality (currently 95 for excellent quality)
- Line 62-65: JPEG encoding parameters
- Adjust
- Frame Rate: Adjust
time.sleep(0.05)for different FPS (currently 20 FPS) - Interpolation: Uses
cv2.INTER_LANCZOS4for best quality when scaling - Progressive JPEG: Enabled for better streaming performance
- 🔓 No Security Code Required: Provides screen sharing without authentication prompts
- 🌐 Web Browser Access: Viewers can connect instantly via any web browser
- ✅ Trusted Environment: Perfect for home networks, family sharing, or trusted colleagues
- 🚀 Instant Access: No approval process - immediate connection once URL is accessed
- 📱 Mobile Friendly: Same responsive design as regular web server
- 🎯 Quality Controls: Supports High/Medium/Low quality settings with persistent storage
- 🔒 Local Network: Designed for trusted local networks (not for public internet)
When to use:
- ✅ Family members accessing your screen
- ✅ Trusted team meetings or presentations
- ✅ Demo environments where security isn't a concern
- ✅ Quick screen sharing without authentication hassle
- ❌ NOT for public/untrusted networks (no security protection)
Quality Settings Explained:
scale_percent = 100: Full resolution (100% of original)JPEG_QUALITY = 95: Near-lossless compressionJPEG_OPTIMIZE = 1: Optimize file sizeJPEG_PROGRESSIVE = 1: Progressive rendering for webINTER_LANCZOS4: Highest quality interpolation algorithm
- Default port can be changed in the main() function
- Reduce Screen Resolution: The server automatically scales to 60% of original size
- Adjust Quality: Lower JPEG quality in
server.pyfor faster streaming - Close Unused Applications: Free up system resources
- Use Wired Connection: Better than WiFi for smoother streaming
- Make sure the server is running before starting the client
- Check if the IP address is correct
- Verify firewall settings
- If using
main.py, ensure you select option 1 (Share) on server PC first
- Double-check the security code (it's case-sensitive, but automatically converted to uppercase)
- Make sure you're entering the current code from the active server session
- Verify you're copying the complete 6-character code
- Check debug output to see what codes are being compared
- Reduce the image quality in
server.py(lowerscale_percentand JPEG quality) - Close bandwidth-heavy applications on both PCs
- Check network connection speed
- Use wired Ethernet instead of WiFi for better stability
- Verify screen capture permissions (especially on macOS)
- Try running with administrator/sudo privileges
- Check if
msslibrary is properly installed - Ensure OpenCV (
cv2) is correctly installed
- Update all dependencies to latest compatible versions
- Check Python version (requires 3.7+)
- Verify all packages in
requirements.txtare installed - Try restarting both applications
- This is normal behavior - just press the Enter key to return to main menu
- If stuck, press
Ctrl+Cto force exit
- Ensure both devices are on the same WiFi network
- Check Windows Firewall settings (allow port 8080)
- Try accessing with PC's IP instead of localhost
- Verify the URL format:
http://IP:8080(not https) - Check if another app is using port 8080
- Move closer to WiFi router
- Close other apps using bandwidth
- Lower quality in
web_server.py(reducescale_percentfrom 100 to 75 or 50) - Use 5GHz WiFi instead of 2.4GHz if available
- Try reducing frame rate (increase
time.sleep(0.05)to0.1for 10 FPS)
- Make sure you're clicking on the screen image area, not the background
- Try clicking and waiting a moment for the zoom to process
- If zoomed, try dragging to see if pan works
- Refresh the page if zoom gets stuck
- F key not working: Make sure you're viewing the screen (not on login page)
- Can't exit fullscreen: Press Esc key or double-click the draggable F button
- White screen in fullscreen: This has been fixed - refresh if you see it
- F button disappeared: It might be dragged off-screen - exit and re-enter fullscreen
Solution:
Make sure both web_client.html and web_client_trusted.html are in the same folder as ScreenShare.exe!
Folder structure:
ScreenShare.exe ✅
web_client.html ✅
web_client_trusted.html ✅
Solution:
- Click "More info"
- Click "Run anyway" This is a false positive - the app is safe!
Possible causes:
- Port already in use
- Firewall blocking Solution:
1. Close other screen sharing apps
2. Check Windows Firewall
3. Try different Cloudflare tunnel (restart option [3])
Check these:
- ✅ Correct IP address?
- ✅ Correct port?
- ✅ Correct security code?
- ✅ Sharer is running?
- ✅ Same network (or using ngrok)?
- ✅ Firewall not blocking? Solution:
For internet sharing:
1. Use Cloudflare tunnels (option [3] or [6])
2. Share Cloudflare URL (not local IP)
- Problem: "Hide Window" option doesn't work
- Reason: Only works on Windows
- Solution: Feature is Windows-only by design
Window Hidden, Can't Find It
- Problem: Hid window, can't get it back
- Solutions:
- Right-click tray icon → Show Window
- Right-click tray icon → Restart
- Right-click tray icon → Exit, then run again
- Reason:
icon.icofile not found - Solutions:
- Place
icon.icoin same folder asmain.py - Use fallback (still works, just different look)
- Place
Possible causes:
- Slow network
- High resolution screen Solution:
• Use local network sharing for better performance
• Close unnecessary applications
• Use wired connection instead of WiFi
• Try trusted mode (option [5]) for fewer authentication delays
Check:
- ✅ Internet connection
- ✅ Cloudflare tunnel running (option [4] or [5] or [7])
- ✅ Keep tunnel window open Solution:
1. Check if tunnel is active
2. Restart Cloudflare: Close and choose option 4] or [5] or [7] again
3. Wait a few seconds for tunnel to establish
4. Try to open it again
- Make sure window has focus
- Click directly on the button
- Try clicking the center of the button
- Changes are instant but may be subtle
- Try switching between HIGH and LOW to see difference
- High-motion content shows more difference
- Click the quality button again
- Select an option from the menu
- Press Q to quit and restart if needed
Use when: Testing or demo on same computer
Sharer: Run option [1] or [2]
Viewer: Use localhost or 127.0.0.1
Use when: Same WiFi or office network
Sharer: Run option [1] or [2]
Viewer: Use LAN IP (e.g., 192.168.1.100)
Find your IP:
Windows: ipconfig
Look for "IPv4 Address"
Use when: Different networks or worldwide
Sharer:
- Run option [5] (Cloudflare HTTP) or [7] (Cloudflare + Trusted)
- Note the Cloudflare URL
Viewer: Use Cloudflare URL (e.g.,
https://abc-def-123.trycloudflare.com)
Problem: Cannot connect from outside
- Check router port forwarding rules
- Verify Windows Firewall allows port
- Test if ISP blocks port (some block 80, 8080)
- Try different port (e.g., 8081, 9000)
Problem: IP address changes
- Setup Dynamic DNS service
- Check ISP if they provide static IP
Problem: Connection very slow
- Reduce image quality in settings
- Check internet upload speed
- Consider local server closer to viewers
Problem: Connection drops frequently
- Check internet stability
- Increase timeout values
- Use wired connection instead of WiFi
# Check what's on port 8080
netstat -ano | findstr :8080
Output:
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 30684
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 5792
# Two processes! Oracle (5792) and Python (30684)# Check what's on port 5000
netstat -ano | findstr :5000
Output:
TCP 0.0.0.0:5000 0.0.0.0:0 LISTENING 30684
# Only Python! No conflicts!-
Reduce Resolution (in
web_server.py):scale_percent = 75 # Instead of 100
-
Lower Quality (for slower connections):
int(cv2.IMWRITE_JPEG_QUALITY), 80 # Instead of 95
-
Reduce Frame Rate:
time.sleep(0.1) # 10 FPS instead of 20
-
Monitor Bandwidth:
- Check your upload speed: speedtest.net
- Required: ~2-5 Mbps upload for good quality
# Kill all ngrok processes
taskkill /F /IM ngrok.exe
# Verify it's gone
tasklist | findstr ngrok# Kill all ngrok processes
pkill ngrok
# Verify it's gone
ps aux | grep ngrokUser Count → FPS Adjustment
0 users → 20 FPS (Full speed, no load)
1-2 users → 20 FPS (Excellent performance)
3-5 users → 15 FPS (Good performance)
6-10 users → 12 FPS (Balanced performance)
10+ users → 8 FPS (Conservative, stable)# Single capture generates ALL quality levels
capture_screen_loop():
capture_once() # Single screen capture
├─ High Quality Frame (100% scale, 95% JPEG)
├─ Medium Quality Frame (85% scale, 85% JPEG)
└─ Low Quality Frame (70% scale, 75% JPEG)
# Each user gets optimal frame instantly
user_requests_frame(quality='medium') → instant_cached_frameReal-time tracking:
- Active viewer count
- Frames captured/served per second
- Average frame processing time
- Per-user bandwidth and quality
- Connection duration and stability# Before: N users × Full processing = N× memory
# After: 1 capture × 3 quality levels = Fixed memory
Memory usage: O(1) instead of O(N)| Users | FPS | Quality Options | CPU Load | Memory | Bandwidth/User |
|---|---|---|---|---|---|
| 1-2 | 20 | High/Med/Low | Low | ~50MB | 1-8 MB/s |
| 3-5 | 15 | High/Med/Low | Medium | ~75MB | 1-6 MB/s |
| 6-10 | 12 | High/Med/Low | Medium | ~100MB | 1-5 MB/s |
| 10+ | 8 | Med/Low Rec. | High | ~125MB | 1-3 MB/s |
✅ 1 User: Excellent (20 FPS, any quality)
✅ 5 Users: Very Good (15 FPS, smooth streaming)
✅ 10 Users: Good (12 FPS, stable performance)
✅ 20 Users: Functional (8 FPS, conservative mode)
✅ 50+ Users: Possible (with medium/low quality)
- Look for the icon in your system tray (bottom-right, near clock)
- Right-click the icon
- Menu appears with options:
- Show Window / Hide Window
- Restart
- Exit
- Double-click tray icon
- Quickly show/hide window
- Fastest way to toggle
Right-click tray icon → Hide Window
- Console disappears
- App keeps running
- Access via tray icon
Right-click tray icon → Show Window
- Console reappears
- Full menu access
Right-click tray icon → Restart
- Complete app reload
- All modules refreshed
Right-click tray icon → Exit
- Clean shutdown
- Resources freed
Not yet implemented, but planned for future:
- Ctrl+Alt+S = Show/Hide
- Ctrl+Alt+R = Restart
- Ctrl+Alt+X = Exit
- This is a basic implementation for educational purposes
- The security code provides minimal security
- Two-factor security: Security code + manual server approval
- For production use, consider:
- SSL/TLS encryption (HTTPS)
- Stronger authentication mechanisms
- Password protection
- Connection logging
- End-to-end encryption
- Server captures the screen using
msslibrary in real-time - Each frame is converted to a numpy array and compressed using OpenCV with JPEG encoding
- Compressed images are serialized with
pickleand sent over TCP socket - Client connects and sends the security code for authentication
- Server asks for manual approval before allowing connection
- Upon approval, client receives, deserializes, and displays frames continuously
- Automatic reconnection if connection drops (3 attempts with 2-second delays)
- Web Server captures screen continuously at 100% resolution in a background thread
- Frames are compressed using JPEG (95% quality) with progressive encoding and optimization
- Uses LANCZOS4 interpolation for highest quality scaling
- Compressed frames stored in memory with thread-safe locking
- HTTP Server serves a responsive HTML/JavaScript interface with modern design
- ThreadingHTTPServer handles multiple simultaneous connections
- Browser connects, displays modern UI with individual digit input boxes
- Client enters security code, sends via AJAX POST request
- Server validates code and queues approval request
- Sequential Approval Processing: Requests processed one at a time in order (FIFO)
- Server asks for manual approval (shows queue status)
- Upon approval, server sends session ID to browser
- Browser receives frames via MJPEG streaming (multipart/x-mixed-replace boundary)
- Client can:
- Zoom: Click any area to zoom into that section (calculates relative position)
- Pan: Drag with mouse/touch when zoomed to navigate
- Fullscreen: Double-click F button or press F key
- Exit Fullscreen: Press Esc key or double-click F button
- Move Controls: Drag F button to any position
- Connection Monitoring: Browser checks
/healthendpoint every 3 seconds - Auto-disconnect Detection: Shows notification if server disconnects
- Optimized for mobile with touch gestures and responsive layout
- 20 FPS streaming for smooth motion
- Two-Factor Security: Security code + manual server approval
- Thread-Safe Operations: All shared data protected with locks
- Approval Queue: Sequential processing prevents overlapping prompts
- Race Condition Prevention: Proper locking on all pending approvals
- Graceful Timeout Handling: Sessions cleaned up properly without crashes
- Exception Handling: Comprehensive error handling prevents server crashes
screen share/
│
├── main.py # Main launcher with menu interface (START HERE!)
├── server.py # Desktop server (screen sharing via socket)
├── web_server.py # Web server (browser-based, mobile-friendly) 🆕
├── web_server_trusted.py # Trusted web server (no security code required) 🆕
├── web_client.html # HTML/JS client for web browser 🆕
├── web_client_trusted.html # HTML/JS client for trusted mode 🆕
├── client.py # Desktop client (screen viewing)
├── cloudflare_helper.py # Cloudflare tunnel integration 🆕
├── requirements.txt # Python dependencies
└── README.md # This file
main.py: Unified launcher - start here! Provides a menu to choose between desktop/web sharing or desktop viewing.server.py: Desktop server that captures and streams screen via TCP sockets. For PC-to-PC connections.web_server.py: HTTP server for browser-based viewing. Perfect for mobile phones and tablets! 🆕- Features: 100% resolution, 95% JPEG quality, 20 FPS streaming
- Threading: ThreadingHTTPServer for multi-user support
- Security: Sequential approval queue system
- Thread-safe: Comprehensive locking mechanisms
web_server_trusted.py: HTTP server for trusted environments (no security code required). 🆕- Features: Same high-quality streaming as regular web server
- Security: No authentication - instant access for trusted networks
- Use case: Family networks, trusted colleagues, demo environments
- Threading: ThreadingHTTPServer for multi-user support
- Quality: Persistent quality settings with session storage
web_client.html: Responsive web interface with modern features. 🆕- UI Components: Individual digit input boxes with auto-focus and paste support
- Zoom System: Click-to-zoom with intelligent section targeting
- Fullscreen: Draggable controls with keyboard shortcuts (F, Esc)
- Notifications: Toast notification system for all events
- Connection Monitoring: Auto-detects disconnections via /health endpoint
- Touch Support: Full mobile gesture support
- Responsive Design: Works on all screen sizes
web_client_trusted.html: Responsive web interface for trusted mode. 🆕- No Authentication: Direct access without security code entry
- Same Features: All zoom, fullscreen, and quality controls as regular client
- Instant Access: Immediately starts viewing screen upon page load
- Quality Controls: High/Medium/Low quality switching with persistence
- Mobile Optimized: Same responsive design for all devices
client.py: Desktop client that connects to server and displays shared screen in OpenCV window.cloudflare_helper.py: Cloudflare tunnel integration for internet access. 🆕- Features: Quick tunnel setup, web and TCP mode support
- Integration: Works with both regular and trusted web servers
- Free: Unlimited bandwidth via Cloudflare's global network
requirements.txt: Lists all required Python packages for easy installation.
Web Server Process
├── Main Thread (HTTP Server)
├── Screen Capture Thread (Background, continuous capture)
├── Approval Processor Thread (Sequential approval handling)
└── HTTP Handler Threads (One per client connection)
├── Handles /verify endpoint
├── Handles /stream endpoint (MJPEG)
└── Handles /health endpoint
Screen → mss.grab() → NumPy Array → cv2.resize() → JPEG Encode → Memory Buffer
↓
Browser ← MJPEG Stream ← HTTP Response ← ThreadingHTTPServer ← Memory Buffer
- frame_lock: Protects current_frame buffer during read/write
- approval_lock: Protects pending_approvals dictionary
- approval_queue: Thread-safe queue for approval requests
- All dictionary operations on shared data are protected
Login View
↓ (Security Code Verification)
Session Established
↓
Viewer Screen (with controls)
├── MJPEG Stream Display
├── Health Check Interval (3s)
├── Zoom Event Handlers
├── Fullscreen Controls
└── Toast Notification System- Screen Capture: Single capture thread, shared buffer
- JPEG Encoding: Progressive with optimization
- Streaming: Direct memory-to-HTTP without file I/O
- Threading: Daemon threads for clean shutdown
- Frame Rate Control: Sleep-based limiting (0.05s = 20 FPS)
- Image Quality: LANCZOS4 interpolation for scaling
| Key | Action |
|---|---|
F |
Toggle fullscreen mode |
Esc |
Exit fullscreen mode |
| Action | Effect |
|---|---|
| Single Click | Zoom into clicked section |
| Drag | Pan when zoomed (move around) |
| Click Again | Zoom out to fit screen |
| Double-Click F Button | Toggle fullscreen |
| Drag F Button | Move button position (fullscreen) |
| Level | Scale | Description | Best For |
|---|---|---|---|
| HIGH | 100% | Best quality | Fast connections (5+ Mbps) |
| MEDIUM | 75% | Balanced (default) | Standard internet (1-5 Mbps) |
| LOW | 50% | Fastest | Slow connections (<1 Mbps) |
- Same PC:
http://localhost:8080 - Other Device:
http://YOUR_PC_IP:8080 - Find IP: Run
ipconfig(Windows) orifconfig(Linux/Mac)
- Desktop Mode: Port 5555 (TCP)
- Web Mode: Port 8080 (HTTP)
- Resolution: 100% (full quality)
- JPEG Quality: 95% (near-lossless)
- Frame Rate: 20 FPS
- Code Length: 6 characters
- Approval Timeout: 60 seconds
- Health Check: Every 3 seconds
A: No! All modes use web browsers (except 1 & 2).
- All screen sharing is browser-based
- Works on any device with a web browser
- No installation required for viewers
Recommendation: Share the URL and viewers just open their browser!
A: Yes! Completely free to use.
Cloudflare tunnels: Free and unlimited
- ✅ Unlimited bandwidth
- ✅ No session limits
- ✅ Global edge network
- ✅ HTTPS encryption
A: Yes! Free to use for personal and commercial projects.
A: Press Ctrl+C in the terminal, or close the window.
A: No, it's randomly generated for security.
A: This EXE is Windows only.
For Mac/Linux, use the Python source code instead.
All modes: Many viewers (limited by your bandwidth)
- Multiple people can connect simultaneously
- Each uses same URL (and security code if not in trusted mode)
- Great for presentations and demonstrations
For Cloudflare (internet): Yes, HTTPS encrypted For local network: Unencrypted (LAN only) Trusted mode: Same encryption as regular mode (just no authentication)
This project is open source and available for educational purposes.
Feel free to fork, modify, and improve this project!
- Read this README (you're here!)
- Check Troubleshooting section above or create an issue in the repository.
Report issues with these details:
- Windows version
- What you were doing
- Error message (if any)
- Steps to reproduce
Thank you for using Screen Sharing Application! Happy screen sharing! 🚀✨
No installation required • Portable • Secure • Easy to use

