Python Forum
controlling multiple server simultaneously. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: controlling multiple server simultaneously. (/thread-10071.html)



controlling multiple server simultaneously. - caligola - May-11-2018

Hi guys,i'm newbie on this forum,i need your help to code a project.

I have 2 vps server with linux and GUI,my goal is to code something for control mouse and keyoboard of each server at the same time.

With a VNC viewer i can use one server at a time,but i need to copy movement over two or more pc's at the same time,evry server must do the same mouse movement over the desktop,same keyboard typing,etc.

is there any library o any ideas to solve this problem? Wall


RE: controlling multiple server simultaneously. - wavic - May-11-2018

You have to use some messaging library/protocol or whatever is called to order the remote systems what to do.
I think zerorpc or pyzmq will do the work. Then I will use pyinput to get the local keyboard and mouse events and for example pyautogui to move the mouse and generate keystrokes on the remote systems.

There are other modules to fit ?fill the requirements.


RE: controlling multiple server simultaneously. - caligola - May-11-2018

(May-11-2018, 12:23 PM)wavic Wrote: You have to use some messaging library/protocol or whatever is called to order the remote systems what to do.
I think zerorpc or pyzmq will do the work. Then I will use pyinput to get the local keyboard and mouse events and for example pyautogui to move the mouse and generate keystrokes on the remote systems.

There are other modules to fit ?fill the requirements.

tnx for addressing me,i have done onli simple scrip util now so i don't know if this is a more complcated project for me but...let's try!

so the idea is to map the "MASTER" pc trought pyimput,then send the data to "SLAVE1","SLAVE2","SLAVEx" trought zeropc and then tell to pyautoguy to follow the commannds?

i don't need to do complicated tasks like copy/paste or tranfer files,just move mouse and keyboard to open files,browser or programs ,simulating an X number of humans doing the same tasks on your own machines.


RE: controlling multiple server simultaneously. - wavic - May-11-2018

It's just as you describe it. Read the input with pyinput and send the raw data to the slaves. They get it and pass it to pyautogui methods which are doing the movement of the mouse and generate the keystrokes. You can serialize the data as json for example. simplejson or ujason are faster libraries in lots of the cases.