This extension allows you to trigger VSCode commands programmatically (through scripts or shortcuts) using websockets.
Features
Every message sent to this extension has to be in JSON format and, if set, encrypted with a password (See Encryption Details).
Every request has to have two keys: reqID and action.
reqID can be anything and will be echoed back as resID in the response.
Action hast to be a valid action, otherwise the request is ignored.
All request parameters are optional and have a default value.
Response parameters marked with a question mark are not included at all, if they don't have a value.
Extension Settings
This extension has two configuration options:
commandsocket.port: The port to use for the WebSocket server.
commandsocket.password: A password to encrypt transactions. Leave this blank to keep the communication unencrypted.
Encryption details
If a password is set, the incoming data is decrypted and the outgoing data is encrypted using that password.
Encryption is handled using the node crypto module using aes-256-gcm.
The key is generated from the password using a key length of 32 and the salt commandsocket-salt.
The encrypted message (in hex format) is then joined with the IV (in hex format) using a pipe symbol (encrypted-message|IV).
For more details find the functions serializeMessage and parseMessage in the extensions source code.