| # vortex@sandbox - AI Agent Desktop Control | |
| > Containerized Linux desktop for AI agents via WebSocket VNC | |
| ## Quick Connect | |
| WebSocket URL: wss://megharudushi-vnc-browser-agent.hf.space/websockify | |
| Protocol: RFB 3.8 (VNC) | |
| Resolution: 1280x720 | |
| Auth: None required | |
| ## Python Example | |
| ```python | |
| import asyncio, struct, websockets | |
| async def control(): | |
| ws = await websockets.connect("wss://megharudushi-vnc-browser-agent.hf.space/websockify", subprotocols=["binary"]) | |
| await ws.recv(); await ws.send(b"RFB 003.008\n") # Handshake | |
| await ws.recv(); await ws.send(bytes([1])) # No auth | |
| await ws.recv(); await ws.send(bytes([1])) # Shared | |
| await ws.recv() # Server init | |
| # Click at (640, 360) | |
| await ws.send(struct.pack(">BBHH", 5, 1, 640, 360)) # Press | |
| await ws.send(struct.pack(">BBHH", 5, 0, 640, 360)) # Release | |
| # Type text | |
| for c in "hello": | |
| await ws.send(struct.pack(">BBHI", 4, 1, 0, ord(c))) # Key down | |
| await ws.send(struct.pack(">BBHI", 4, 0, 0, ord(c))) # Key up | |
| asyncio.run(control()) | |
| ``` | |
| ## Commands | |
| Mouse: struct.pack(">BBHH", 5, button_mask, x, y) | |
| Key: struct.pack(">BBHI", 4, down, 0, keycode) | |
| Screenshot: struct.pack(">BBHHHH", 3, 0, 0, 0, 1280, 720) | |
| ## See llms-full.txt for complete API reference | |