Skip to content

Reeyuki/Waydroid-Remote-Web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waydroid Remote Web

A web-based screen mirroring and remote control interface for Waydroid Android containers. Stream your Waydroid display to any web browser and control it with touch, gestures, and keyboard input.

Features

  • Real-time screen mirroring - Low-latency H.264 video streaming from Waydroid
  • Full remote control - Touch, tap, swipe, and keyboard input support
  • Web-based interface - Access from any modern web browser, no client installation required
  • WebSocket communication - Efficient bidirectional communication between server and client
  • WebCodecs decoding - Hardware-accelerated video decoding in the browser
  • Production ready - Includes nginx configuration for SSL/TLS deployment

How It Works

  1. Server (Node.js) connects to your Waydroid container via ADB over the local network
  2. Captures screen using adb screenrecord in H.264 format
  3. Streams video data to connected web browsers via WebSocket
  4. Client (browser) decodes H.264 using WebCodecs API and renders to canvas
  5. User input is sent back through WebSocket to control the Waydroid instance

Prerequisites

  • Waydroid installed and running on your Linux system
  • Node.js (version 16 or higher)
  • ADB (Android Debug Bridge) - usually comes with Waydroid
  • Modern web browser with WebCodecs support (Chrome, Edge, Firefox 105+)

Installation

  1. Clone this repository:
git clone https://github.com/Reeyuki/Waydroid-Remote-Web
cd waydroid-web
  1. Install dependencies:
npm install
  1. Ensure Waydroid is running and ADB is connected:
# Start Waydroid if not already running
waydroid session start

# Connect to Waydroid via ADB (default IP: 192.168.240.112)
adb connect 192.168.240.112:5555

# Verify connection
adb devices
  1. Update the device IP in main.js if your Waydroid container uses a different address:
const DEVICE_IP = "192.168.240.112"; // Change if needed

Usage

Development

Start the development server:

npm start

Open your web browser and navigate to:

http://localhost:8081

Production Deployment

  1. Use the provided nginx configuration for SSL/TLS termination:
# Update nginx.conf with your domain and SSL certificates
sudo cp nginx.conf /etc/nginx/sites-available/waydroid-web
sudo ln -s /etc/nginx/sites-available/waydroid-web /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
  1. Start the Node.js server (use a process manager like PM2 for production):
# Using PM2
npm install -g pm2
pm2 start main.js --name waydroid-web
pm2 startup
pm2 save
  1. Access via your domain:
https://your-domain.com

Controls

  • Tap - Single finger tap to click
  • Swipe - Drag finger to swipe/scroll
  • Keyboard - Use physical keyboard for text input
  • Debug info - Green overlay shows connection status and performance metrics

Configuration

Server Options

Edit main.js to customize:

const DEVICE_IP = "192.168.240.112";  // Waydroid container IP
const PORT = 8081;                     // Server port
const BIT_RATE = "8000000";            // Video bitrate (8Mbps default)

Video Quality

Adjust video quality by modifying the screenrecord parameters in main.js:

// In spawnScreenrecord() function
"--bit-rate", "8000000",  // Higher = better quality, more bandwidth

Troubleshooting

Connection Issues

  • "adb: device not found" - Ensure Waydroid is running and ADB is connected
  • WebSocket connection failed - Check if the server is running and port is accessible
  • Black screen - Verify Waydroid screen recording works: adb -s 192.168.240.112:5555 exec-out screenrecord --output-format=h264 --bit-rate=8000000 - | ffplay -

Performance Issues

  • Laggy video - Reduce bitrate in main.js or check network bandwidth
  • High CPU usage - Ensure hardware acceleration is available in your browser
  • Dropped frames - Check debug overlay for decode queue size and frame drops

Browser Compatibility

  • Chrome/Edge - Full support with hardware acceleration
  • Firefox - Support from version 105+, may need media.webcodecs.enabled flag
  • Safari - Limited WebCodecs support, may not work

Security Considerations

  • This tool exposes your Waydroid session to anyone who can access the web interface
  • Use SSL/TLS in production (nginx configuration provided)
  • Consider adding authentication for additional security
  • Only run on trusted networks or implement proper access controls

Development

Project Structure

├── main.js          # Node.js server with ADB integration
├── nginx.conf       # Production nginx configuration
├── package.json     # Node.js dependencies
└── public/
    └── index.html   # Web client with WebCodecs decoder

Technologies

  • Backend: Node.js, Express, WebSocket, ADB
  • Frontend: HTML5 Canvas, WebCodecs API, WebSocket
  • Video: H.264 encoding/decoding, Annex-B format handling
  • Deployment: nginx, SSL/TLS, PM2 process management

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly with different Waydroid configurations
  5. Submit a pull request

License

This project is open source. Please check the license file for details.

Acknowledgments

  • Inspired by scrcpy - Display and control Android devices
  • Built for the Waydroid community
  • Uses WebCodecs for efficient browser-based video decoding

About

Web-based screen mirroring and remote control interface for Waydroid Android containers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors