This is a draft for a solution that enables a mobile device to control a mouse pointer. For convenience we will set the server as the phone, and the client as the device with the mouse.
We have a webpage that we will use in the device to get the rotation around two axes. We use an EventListener for deviceorientation.