agot137

remote_execution_from_VSCODE

Oct 11th, 2026
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. local WS_URL = "ws://127.0.0.1:10000/ws"
  2.  
  3. print("Csatlakozas: " .. WS_URL)
  4. local ws, err = http.websocket(WS_URL)
  5.  
  6. if not ws then
  7. printError("Sikertelen csatlakozas: " .. tostring(err))
  8. return
  9. end
  10.  
  11. print("Sikeresen csatlakozva! Varakozas a VS Code-ra...")
  12.  
  13. while true do
  14. local event, url, message = os.pullEvent("websocket_message")
  15.  
  16. if url == WS_URL then
  17. print("\n--- Uj kod futtatasa ---")
  18.  
  19. local func, syntax_err = load(message, "vscode_remote")
  20.  
  21. if not func then
  22. printError("Szintaktikai hiba:")
  23. printError(syntax_err)
  24. else
  25. local success, runtime_err = pcall(func)
  26.  
  27. if not success then
  28. printError("Futasideju hiba:")
  29. printError(runtime_err)
  30. else
  31. print("--- Futtatas vege ---")
  32. end
  33. end
  34. end
  35. end
Advertisement