Setting the password is done by sending a json object:
{"action":"set", "key":"<key name>", "value":"<secret>"}
Retrieving the password is done the same way, but now action is 'get' and no value is sent:
{"action":"get", "key":"<key name>"}
The response is also a json object containing of two entries:
{"result":"<result>", "value":"<value>"}
The <result>
can either be:
- "ok" : everything went fine
- "error" : an error occured
The <value>
contains the secret in case of a successful get request,
else it is just empty.
An example netcat session:
$ netcat 127.0.0.1 6969
{"action":"set", "key":"test", "value":"test123"}
{"result":"ok","value":""}
$ netcat 127.0.0.1 6969
{"action":"get", "key":"test"}
{"result":"ok","value":"test123"}