Skip to main content

Effortless screen sharing via browser - no installation required on viewer devices

Project description

๐Ÿ“ก Sharer - Effortless Screen Sharing

Cast your screen to phones, tablets, laptops, or Smart TVs โ€” instantly โ€” using just a browser and a QR code. No installations, no cables, no nonsense.

PyPI version Python Support License: MIT

โœจ Features

  • ** Zero-install screen sharing** โ€” Works via browser, no apps needed on viewer devices
  • ** Smartphone-friendly** โ€” Scan QR code and view instantly
  • ** Smart TV-ready** โ€” Works with any device with a browser
  • ** Touch-to-click** โ€” Tap the screen on viewer device to click on host machine
  • ** Automatic resolution scaling** โ€” Looks great on any screen size
  • ** Local network only** โ€” Your screen stays secure on your network
  • ** Real-time streaming** โ€” Low latency WebSocket-based streaming (~10 FPS)
  • ** Beautiful UI** โ€” Modern, responsive interface for both host and viewers
  • ** QR & URL access** โ€” Multiple ways to connect viewers

Installation

pip install sharer

System Requirements

  • Python: 3.7 or higher
  • Operating Systems: Windows, macOS, Linux
  • Network: Local network connectivity

Platform-Specific Setup

macOS:

# Grant Screen Recording permission
# System Preferences โ†’ Security & Privacy โ†’ Privacy โ†’ Screen Recording
# Add Terminal or your Python IDE

# Grant Accessibility permission for mouse control
# System Preferences โ†’ Security & Privacy โ†’ Privacy โ†’ Accessibility

Linux:

# Install X11 dependencies
sudo apt-get update
sudo apt-get install python3-xlib python3-dev scrot

# For Wayland users
sudo apt-get install xwayland

Windows:

  • No additional setup required
  • May need to allow Python through Windows Firewall when prompted

Quick Start

Basic Usage

Simply run:

sharer

Or as a Python module:

python -m sharer

That's it! The app will:

  1. Open a control panel in your browser automatically
  2. Display a QR code for easy scanning
  3. Show the viewer URL
  4. Start streaming your screen in real-time

Viewing the Screen

Method 1: Scan QR Code (Easiest)

  1. Open your phone's camera app
  2. Point it at the QR code on the host screen
  3. Tap the notification to open in browser
  4. Screen appears instantly!

Method 2: Enter URL Manually

  1. On any device, open a web browser
  2. Navigate to the URL shown on the host screen
  3. Example: http://192.168.1.100:5000/view

Controlling the Host

  • Click/Tap anywhere on the viewer screen
  • The click will be executed on the host machine at the corresponding position
  • Perfect for presentations, demos, or remote support

๐ŸŽฏ Use Cases

Presentations & Demos

  • Share slides to audience devices
  • Interactive product demonstrations
  • Conference presentations

Remote Support

  • Help family/friends with tech issues
  • IT support and troubleshooting
  • Remote tutoring

Multi-Device Workflows

  • Use tablet as second screen
  • Monitor dashboards on multiple devices
  • Cast to Smart TV browser

Collaboration

  • Share your screen in meetings
  • Code reviews and pair programming
  • Design feedback sessions

Entertainment

  • Stream gameplay to other devices
  • Watch content on bigger screens
  • Share photos/videos with friends

Education

  • Share teaching content to students
  • Interactive lessons
  • Student device monitoring

๐Ÿ“– Detailed Usage

Starting the Server

# Default settings (port 5000)
sharer

# The server will:
# - Bind to 0.0.0.0:5000 (accessible on local network)
# - Auto-detect your local IP address
# - Generate a unique QR code
# - Open control panel in default browser

Control Panel Features

When you run sharer, the control panel shows:

  • QR Code - Large, scannable code for instant connection
  • Viewer URL - Direct link to share
  • Active Viewers Count - See who's connected in real-time
  • Local IP Address - Your machine's network address
  • Instructions - Quick how-to guide

Viewer Interface

The viewer page provides:

  • Full-screen display - Your screen fills the viewer's browser
  • Responsive scaling - Automatically fits any screen size
  • Touch/click support - Tap to interact
  • Connection status - Live connection indicator
  • Click feedback - Visual pulse effect on clicks

Stopping the Server

Press Ctrl+C in the terminal to stop sharing:

  Press Ctrl+C to stop

^C
 Sharer stopped. Thanks for using!

Advanced Configuration

Custom Port

from sharer.server import ScreenSharer

sharer = ScreenSharer()
sharer.port = 8080  # Custom port instead of default 5000
sharer.run()

Programmatic Usage

from sharer import start_server

# Start with default settings
start_server()

Integration Example

import threading
from sharer import start_server

def start_background_sharing():
    """Start screen sharing in a background thread"""
    thread = threading.Thread(target=start_server, daemon=True)
    thread.start()
    print("Screen sharing started in background")

if __name__ == '__main__':
    start_background_sharing()
    # Your application continues running
    # Screen sharing runs in parallel

Custom Frame Rate

Edit the capture loop in server.py:

# In screen_capture_loop method
time.sleep(0.1)  # 10 FPS (default)
time.sleep(0.05) # 20 FPS (smoother, more bandwidth)
time.sleep(0.2)  # 5 FPS (lower bandwidth)

Adjust Image Quality

Edit the capture method in server.py:

# In capture_screen method
img.save(buffer, format='JPEG', quality=70, optimize=True)  # Default
img.save(buffer, format='JPEG', quality=50, optimize=True)  # Lower quality, faster
img.save(buffer, format='JPEG', quality=90, optimize=True)  # Higher quality, slower

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    Host PC       โ”‚                      โ”‚  Viewer Device   โ”‚
โ”‚                  โ”‚                      โ”‚                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚                      โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Screen    โ”‚  โ”‚                      โ”‚  โ”‚  Browser   โ”‚  โ”‚
โ”‚  โ”‚  Capture   โ”‚  โ”‚  WebSocket           โ”‚  โ”‚  Display   โ”‚  โ”‚
โ”‚  โ”‚  (mss)     โ”‚โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ–บโ”‚            โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚  JPEG Frames         โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                  โ”‚  (~10 FPS)           โ”‚        โ”‚         โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚                      โ”‚        โ”‚         โ”‚
โ”‚  โ”‚  Mouse     โ”‚  โ”‚                      โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Control   โ”‚โ—„โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”‚  Touch/    โ”‚  โ”‚
โ”‚  โ”‚ (PyAutoGUI)โ”‚  โ”‚  Click Events        โ”‚  โ”‚  Click     โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚  {x, y coords}       โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                  โ”‚                      โ”‚                  โ”‚
โ”‚  Flask + SocketIOโ”‚                      โ”‚   JavaScript     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Technology Stack

  • Backend: Python 3.7+

    • Flask (web framework)
    • Flask-SocketIO (WebSocket communication)
    • mss (fast screen capture)
    • Pillow (image processing)
    • PyAutoGUI (mouse control)
    • qrcode (QR code generation)
  • Frontend: Vanilla JavaScript + HTML5

    • Socket.IO client
    • Canvas/Image rendering
    • Touch event handling

Security Considerations

Network Security

  • Local Network Only: Sharer binds to your local network by default
  • No Internet Exposure: Does not expose your screen to the internet
  • Firewall: Ensure port 5000 is accessible only on trusted networks

Access Control

  • No Built-in Authentication: Anyone on your network can view/control
  • Trust-based: Only use on trusted networks with trusted users
  • Mouse Control: Viewers can click on your screen - use responsibly

Best Practices

  1. Only run on trusted private networks (home, office)
  2. Stop the server when not in use
  3. Be aware of sensitive information on screen
  4. Don't use on public WiFi networks
  5. Don't share viewer URLs publicly

Adding Authentication (Advanced)

# Example: Token-based authentication
from functools import wraps
from flask import request, abort

SECRET_TOKEN = "your-secret-token-here"

def require_token(f):
    @wraps(f)
    def decorated(*args, **kwargs):
        token = request.args.get('token')
        if token != SECRET_TOKEN:
            abort(401)
        return f(*args, **kwargs)
    return decorated

# Apply to viewer route
@app.route('/view')
@require_token
def view():
    return render_template_string(VIEWER_HTML)

Troubleshooting

Connection Issues

Problem: "Connection Failed" or "Cannot connect to server"

Solutions:

  • Ensure both devices are on the same WiFi network
  • Check if firewall is blocking port 5000
  • Try accessing via IP address instead of hostname
  • Verify the server is running (check terminal output)
  • Disable VPN temporarily

Windows Firewall:

# Allow Python through firewall when prompted
# Or manually add exception in Windows Defender Firewall settings

Screen Capture Issues

Problem: "No screen capture" or blank screen

macOS:

# Grant Screen Recording permission
# System Preferences โ†’ Security & Privacy โ†’ Privacy โ†’ Screen Recording
# Add Terminal, iTerm, or your Python IDE
# Restart the application

Linux:

# Install required packages
sudo apt-get install python3-xlib scrot

# For Wayland
export QT_QPA_PLATFORM=wayland
# Or use XWayland

Windows:

  • Usually works out of the box
  • Check if another screen capture app is running

Click/Mouse Control Issues

Problem: Clicks not registering on host

macOS:

# Grant Accessibility permission
# System Preferences โ†’ Security & Privacy โ†’ Privacy โ†’ Accessibility
# Add Terminal or Python IDE
# Restart the application

Linux:

# May need to run with sudo (not recommended for security)
# Or configure proper permissions for input devices
sudo usermod -a -G input $USER
# Log out and back in

Windows:

  • PyAutoGUI should work without additional setup
  • Ensure no other automation tools are interfering

Performance Issues

Problem: Lag, stuttering, or slow frame rate

Solutions:

  • Reduce JPEG quality (edit server.py, set quality to 50-60)
  • Lower frame rate (increase sleep time to 0.2 for 5 FPS)
  • Close unnecessary applications on host
  • Use wired Ethernet connection for host if possible
  • Ensure strong WiFi signal for viewers
  • Reduce screen resolution on host machine

Port Already in Use

Problem: "Address already in use" error

Solution:

# Find process using port 5000
# Linux/macOS:
lsof -i :5000
kill -9 <PID>

# Windows:
netstat -ano | findstr :5000
taskkill /PID <PID> /F

# Or use a different port in your code

Dependencies Installation Fails

Problem: pip install fails for dependencies

Solutions:

# Upgrade pip
python -m pip install --upgrade pip

# Install wheel
pip install wheel

# macOS: Install Xcode Command Line Tools
xcode-select --install

# Linux: Install build dependencies
sudo apt-get install python3-dev build-essential

Performance Metrics

Typical performance on standard hardware:

Metric Value Notes
Frame Rate 8-12 FPS Adjustable
Latency 100-300ms Depends on network
Bandwidth 1-5 Mbps Per viewer
CPU Usage 5-15% Host machine
Resolution 1:1 Scales automatically

Dependencies

Flask>=2.0.0           # Web framework
flask-socketio>=5.0.0  # WebSocket support
python-socketio>=5.0.0 # SocketIO protocol
mss>=6.0.0             # Fast cross-platform screen capture
Pillow>=9.0.0          # Image processing
qrcode[pil]>=7.0.0     # QR code generation
pyautogui>=0.9.53      # Mouse/keyboard control

Contributing

Contributions are welcome! We'd love your help making Sharer better.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/niterousnebula/sharer.git
cd sharer

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e .

# Install development dependencies
pip install pytest black flake8

# Run tests
pytest

# Format code
black sharer/

# Lint
flake8 sharer/

Areas for Contribution

  • Bug fixes
  • New features
  • Documentation improvements
  • Test coverage
  • Internationalization
  • UI/UX enhancements

License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2024 Sharer Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

Acknowledgments

  • Built with Python, Flask, and WebSockets
  • Inspired by the need for simple, cable-free screen sharing
  • Thanks to the open-source community
  • Special thanks to all contributors and users!

Getting Help

  1. Check this README first
  2. Search existing GitHub issues
  3. Create a new issue with details:
    • Your OS and Python version
    • Complete error message
    • Steps to reproduce

Changelog

v1.0.0 (2024-01-24)

  • Initial release
  • Zero-install browser-based sharing
  • QR code generation
  • Touch-to-click functionality
  • Auto-scaling for all devices
  • WebSocket real-time streaming

Star History

If you find Sharer useful, please consider giving it a star โญ on GitHub!

Star History Chart

๐Ÿ’– Sponsors

Become a sponsor to support ongoing development!


Made with โค๏ธ for effortless screen sharing

Star this repo if you find it useful!

โฌ† Back to top

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysharekit-1.0.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysharekit-1.0.2-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file pysharekit-1.0.2.tar.gz.

File metadata

  • Download URL: pysharekit-1.0.2.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pysharekit-1.0.2.tar.gz
Algorithm Hash digest
SHA256 71fed2aeb6b233a8ff79e1f1c8545dc6516e1002647d26e1d4c9ab833224b4a7
MD5 a3b05620e2e50b0e59e2aebdc85e4782
BLAKE2b-256 20533ee1d1677020a9391dc17af83dc4a1e48385bd0eff64bb395a3a9e2f0386

See more details on using hashes here.

File details

Details for the file pysharekit-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pysharekit-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pysharekit-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61b39adb50ae07cc423d5af11cb84ccd510c05bb61054a99212eaa543c22296a
MD5 e2f38b2062e985fbdb2b80565b238175
BLAKE2b-256 b1108868b10634bec64574c8af21c913d3a33e823cfc954625ccf726b1193000

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page