PortDesk transforms any device into a PC controller. It works seamlessly over your local network (Wi-Fi or USB) or via the internetโallowing you to control your computer by simply opening a URL in any web browser.
The only official and verified release of PortDesk is hosted at:
๐ https://github.com/Lucky-abdo/PortDesk
Copies or forks obtained from third-party websites, messaging groups, or unofficial links may have been modified. We cannot guarantee that such versions retain the same privacy standards, security model, or integrity as the original. Please exercise caution and always verify the source before running any code on your machine.
Check notes.txt first โ it covers common problems, platform-specific fixes, CLI flags, PIN/pattern recovery, TOFU certificate warnings, and streaming troubleshooting. Most questions are answered there.
give this prompt to ai
Read the following PortDesk documentation and give the user a clear, concise summary covering only: what PortDesk is, how to install it, how to run it, and the most important notes (HTTPS for mic/gyro, FFmpeg for H264 streaming, dxcam for best Windows performance, PIN security, whitelist system). Skip detailed platform troubleshooting and feature descriptions. Be brief.
--- PASTE DOCUMENTATION BELOW ---python -m pip install -r requirements.txtpython portdesk-server.pyRecommended: Use the start file for best results โ on Windows use
start_portdesk.bat, on Linux/macOS use the matching shell script. This prevents focus issues with keyboard input.
You'll see something like:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฎ PortDesk v1.0
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
[USB] adb reverse tcp:5000 tcp:5000 โ http://localhost:5000
[WiFi] http://192.168.1.x:5000
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- WiFi: Open
http://192.168.1.x:5000in any browser on any device on the same network - USB (Android): Run
adb reverse tcp:5000 tcp:5000first, then openhttp://localhost:5000
You can use PortDesk without any WiFi router by creating a hotspot directly from your PC.
Windows:
- Go to Settings โ Network โ Mobile Hotspot and turn it on
- Connect your phone to your PC's hotspot
- Run
portdesk-server.pyโ the IP shown in the terminal will be your hotspot IP - Open that IP in your phone's browser
Android tethering (reverse):
- Connect your phone via USB
- Enable USB tethering on your phone
- Run
adb reverse tcp:5000 tcp:5000 - Open
http://localhost:5000on your phone
Hotspot mode works with zero internet โ the connection stays local between your PC and your device.
- Connect your device and PC to the same WiFi network
- Open the IP shown in the terminal on any browser
- Works from phones, tablets, laptops, other PCs โ anything with a browser
Make sure you are on the main network, not a guest or mobile data network.
Requires ADB (Android Debug Bridge) installed on PC.
# Enable USB Debugging on your Android device first, then:
adb reverse tcp:5000 tcp:5000Then open http://localhost:5000 on your device.
For non-Android devices (iPhone, iPad, laptop) just use WiFi mode โ USB mode is Android-specific.
PortDesk operates in two layers automatically:
| Layer | Mechanism | When |
|---|---|---|
| 1 | Direct WebSocket (LAN/USB) | Same network โ always tried first |
| 2 | WebRTC + STUN (P2P) | Different networks โ auto-fallback |
Layer 2 uses free Google STUN servers and requires no installation. It will work if neither device is behind double-NAT (CGNAT). If it fails, see the options below.
If STUN fails (common with mobile data or ISP CGNAT), the recommended approach is a VPN overlay tool. These create a virtual LAN between your devices, making PortDesk work exactly as if both were on the same WiFi โ no code changes needed on either side.
Recommended: NetBird (open-source, self-hostable, stronger security model)
- Download: https://netbird.io
- Install on both PC and phone, sign in with the same account
- Use the NetBird IP shown in the dashboard instead of your LAN IP
Alternative: Tailscale (easier setup, same concept)
- Download: https://tailscale.com
- Install on both devices, sign in
- Use the Tailscale IP (100.x.x.x) instead of your LAN IP
Note on MTU: Both tools use a slightly reduced MTU (~1280โ1400 bytes) to accommodate encryption headers. PortDesk's upload and streaming code handles this transparently via chunked I/O โ no manual configuration needed.
Security note: PortDesk's whitelist system uses the tunnel IP. Add it once via Settings โ Add this device to whitelist.
The mobile microphone feature requires a secure connection (HTTPS).
python gen_cert.py # generates cert.pem and key.pem
python portdesk-server.py # auto-detects the certificates and starts HTTPSThen use https:// instead of http:// when opening on your device.
Accept the self-signed certificate warning in the browser.
- Move finger = move mouse
- Tap = left click
- Long press = right click
- Two fingers = scroll
- Scroll buttons on the side
Press the ๐ Gyro button to use your device's physical tilt (mobile/tablet) as mouse movement.
- Calibrate (๐ฏ): Sets the current phone angle as "center"
- Sensitivity: Adjustable in Settings
- Dead Zone: Minimum tilt before movement registers
Press ๐ง AI to enable the AI sensitivity calibration system.
It watches how you move and automatically adjusts gyro sensitivity and dead zone to match your natural hand movement style.
The more you use it, the more accurate it gets.
Your learned profile is saved in the browser and survives page refreshes.
Reset it anytime from Settings โ AI Gesture Reset.
Pre-built keyboard shortcuts organized by category:
- System: Copy, Paste, Undo, Redo, Select All, Save, Cut, Search
- Windows: Alt+Tab, Win+D (Desktop), Win+L (Lock), Alt+F4, Win+E, Task Manager, Screenshot, Task View
- Media: Play/Pause, Next, Previous, Mute, Volume Up/Down
Dedicated controls for PowerPoint / Google Slides:
- Start / End slideshow
- Next / Previous slide
- Arrow keys, Black screen, White screen
Customizable gamepad layout with two controller types: PS and Xbox.
Profiles: Create multiple profiles for different games. Long-press a profile to delete it.
Full Mode ๐ฎ: Hides all UI and shows only the controller canvas in fullscreen. Tap "Exit Gaming Mode" to return.
Editor (โ๏ธ): Customize button layout:
- Hold & drag a button from the Palette (top bar) onto the canvas
- Tap a placed button to select it
- Long press a placed button to assign a key/shortcut to it
- Drag the resize handle (bottom-right) to resize
- Tap โ to remove a button
Camera Wheel: A special circular control in the palette (โ) that renders as a steering wheel. Use it for camera control in 3D games โ drag your finger to push the wheel in any direction and it continuously moves the mouse.
Stats (๐): Shows CPU usage, temperature, and RAM usage in real-time while gaming.
Mirror your PC screen to your device.
- Adjust resolution, quality, FPS
- Multi-monitor support
- Cursor color customization
- Touchpad and keyboard available while viewing
Streaming modes:
- H264 (default when FFmpeg is installed): hardware-encoded, low bandwidth, smooth at high FPS
- JPEG (fallback): works without FFmpeg, higher bandwidth
On Windows, install
dxcamfor best capture performance (pip install dxcam). Install FFmpeg for H264 hardware encoding (winget install ffmpeg).
Browse, manage, and transfer files between your device and PC.
- Navigate: Tap folders to open, tap files to download
- Breadcrumb: Shows current path, tap any part to jump back
- Sort: By name, date, size, or type
- Select: Tap items to select, then Download / Delete
- Upload: Tap the Upload button to send files from your device to the PC
- New folder / New file: Buttons in the toolbar
- Long press or right-click any item for the context menu:
- Copy, Cut, Paste
- Rename
- Create Shortcut
- Properties
- Delete
Record and replay sequences of actions.
- Tap โบ Record
- Add steps: Click, Key, Type text, or Wait
- Give it a name and tap ๐พ Save
- Tap โถ Run to execute it anytime
Macros are saved on the PC in portdesk_macros.json.
View running processes, sorted by CPU usage. Tap โ to terminate any process.
Enable Auto for live refresh every 3 seconds.
Schedule macros to run at specific times.
- Pick a time
- Name the task
- Select a macro
- Tap + Add
Enable/disable individual tasks with the toggle. The server checks every 10 seconds.
Two views:
- Server: Events logged by the server
- Client: Real-time JavaScript log from your device โ useful for debugging
- Touch sensitivity, gyro sensitivity, dead zone, scroll speed
- Haptic feedback, sound feedback
- Auto-sleep timer
- PIN lock (6-digit) and Pattern lock
- Backup & restore settings (JSON export/import)
- Whitelist management
- AI reset
- Light/Dark theme
- Language (Arabic / English)
- Remote Audio (requires VB-Audio on Windows)
- Mobile Microphone
How it works:
- When a new device tries to connect over WiFi, the server prints a prompt in the terminal asking you to allow or deny it
- Type
yto add the device to the whitelist,nto reject - The whitelist is saved in
portdesk_security.json - Whitelisted devices connect automatically in the future
PIN Lock:
- Settings โ Set PIN โ set a 6-digit PIN, or use Set Pattern for a gesture-based lock
- Anyone opening the URL must enter it before accessing the controller
- PIN is verified server-side using bcrypt. A SHA-256 hash is also stored locally in the browser for offline lock functionality
- After 5 wrong attempts, the server locks the IP for 60 seconds (escalating: 60s โ 180s โ 300s)
Manage the whitelist from the phone:
- Settings โ Add this device to whitelist (adds current device)
- Settings โ Remove myself from whitelist (removes only your own device โ no device can remove others)
Streams your PC's audio to your device in real-time.
Windows: Requires VB-Audio Virtual Cable.
Set your app's audio output to "CABLE Input". PortDesk reads from "CABLE Output".
Linux: Uses PulseAudio โ no extra software needed.
Uses your device's microphone as a virtual mic on the PC.
Windows: Requires VB-Audio Virtual Cable. PortDesk outputs to "CABLE Input".
Requires HTTPS (see HTTPS setup above).
| Feature | Windows | Linux | macOS |
|---|---|---|---|
| Mouse & Keyboard | โ | โ | โ |
| Screen Mirroring | โ | โ | โ |
| CPU Temperature | โ CoreTemp | โ via psutil | โ powermetrics |
| Win/Meta shortcuts | โ | โ | โ |
| Remote Audio | โ VB-Audio | โ PulseAudio | |
| Mobile Mic | โ VB-Audio | โ | |
| File Shortcuts (.lnk) | โ | .desktop | symlink |
- Screen mirroring FPS depends on your network speed and PC performance
- H264 streaming requires FFmpeg installed in PATH โ falls back to JPEG automatically without it
- Mobile microphone requires HTTPS (generate a certificate first)
- Remote audio on macOS has limited support
- Gyroscope on iOS requires user permission (browser will ask on first use)
- Win key shortcuts (Win+D, Win+L, etc.) may not work if the server terminal window has focus โ minimize it or use the
.batlauncher
| File | Description |
|---|---|
portdesk-server.py |
The FastAPI server โ run this on your PC |
portdesk_client.html |
The phone UI โ served automatically by the server |
gen_cert.py |
Generates self-signed SSL certificate for HTTPS |
fixer.py |
Diagnostics and auto-repair tool |
requirements.txt |
Python dependencies |
notes.txt |
Troubleshooting, CLI flags, known issues, and recovery guides |
portdesk_security.json |
Whitelist (auto-created, not in repo) |
portdesk_macros.json |
Saved macros (auto-created) |
portdesk_scheduled.json |
Scheduled tasks (auto-created) |
portdesk_events.log |
Server event log (auto-created) |
MIT License โ see LICENSE
PortDesk was built with the assistance of AI tools. This is mentioned in the spirit of transparency โ the architecture, decisions, and direction were by me, but AI was used throughout the development process for code generation, debugging, and documentation.