This repository contains a Node.js server and a Python Windows client for taking remote screenshots.
Structure:
server/ - Node.js + WebSocket server and mobile frontendclient/ - Python Windows client that captures screen and sends PNGQuick start:
cd server
npm install
npm start
cd client python -m pip install -r requirements.txt python client.py --server ws://<server-host>:3000 --id mypc
http://<server-host>:3000 and tap "Take Screenshot".iPad / Viewer 使用说明:
http://<server-host>:3000/viewer.html。该页面会作为 viewer 向服务器注册并等待来自客户端的截图。http://<server-host>:3000/(或 index.html),此页面作为 controller 注册,点击“Take Screenshot”将向服务器发送截图请求。request_screenshot 到服务器。take_screenshot 转发给已注册的 Windows 客户端(client/client.py)。screenshot_result(base64 PNG)到服务器。screenshot_result 转发给注册为 viewer(即 viewer.html)的连接,iPad 会实时显示该截图。注意事项:
ws://,若在公网使用请考虑部署 TLS(wss://)并加入认证或配对流程以避免未授权访问。client/client.py 做一次模拟测试(但容器/服务器的截图与真实 Windows 屏幕不同)。