INNER CODE UNIT · Python

do_GET

sailor-sh/CK-X · remote-desktop/agent.py:6

    def do_GET(self):
        if self.path == '/restart-vnc-session':
            try:
                subprocess.Popen("vncserver -kill :1 && vncserver :1", shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
                self.respond(200, {})
            except Exception as e:
                self.respond(500, {"error": str(e)})
    
    def do_POST(self):
        if self.path == '/clipboard-paste':
            content_length = int(self.headers['Content-Length'])
            post_data = self.rfile.read(content_length).decode("utf-8")
            
            try:
                data = json.loads(post_data)
                clipboard_content = data.get("content")
                if not clipboard_content:
                    self.respond(400, {"error": "Missing clipboard content"})

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…