How to send a keystroke from the community api
Hello,
Has anyone successfully sent a keystroke using the community api?
I want to write an ansible playbook on a cron job to call the api and send a keystroke to keep the end device from locking
Currently I downloaded Burp and am seeing the http history under the proxy tab, I am not able how to make a post call to the api from postman
Example:
https://myipaddress/socket.io/keystroke
Body
{
"code": "Enter"
}
"The client is using an unsupported version of the Socket.IO or Engine.IO protocols"
- Michael Lynch @michael2022-07-07 18:16:45.367Z
TinyPilot sends the keystrokes to the backend over websockets. It looks like you might be trying to just sent a standard REST request, so the backend can't understand it because it's expecting a websockets connection rather than an HTTP POST.
I haven't used Postman, but it looks like they support websockets:
https://learning.postman.com/docs/sending-requests/supported-api-frameworks/websocket/