Protocol version: "0.3"
Every json message must be minimized (i.e. must not contain newlines) and be followed by a newline. This rule makes receiving and parsing the messages easier because you can read until a newline comes and you will parse every json message seperately because you won't read multiple json messages from the buffer at a time.
The GUI creates a new instance of the CLI with parameter --machine
. Then the GUI sends a connect command to connect to a server.
The CLI then tries to establish a connection to the given server and tells the GUI if the connection was successful.
GUI:
write: "connect" ip_address port
Alternatively, it is possible to only pass an ip address, then by default port 1234 is used.
CLI:
{
"command": "connect",
"accept": bool,
"error": string
}
To connect to a server, the CLI has to do a version check. Once that is successful, the GUI will pass the username and password to establish a connection.
CLI:
{
"command": "version",
"serverversion": string,
"clientversion": string,
"accept": bool
}
If accept
is true
the connection is valid. Else the connection will be terminated after the server answered. In this case it it possible to connect again (possibly to another server).
The GUI will send a login or signup request into the pipe. If the response contains a "true" for accept, the login was successful.
GUI:
write: "login" username password
CLI:
{
"command": "login",
"accept": bool,
"error": string
}
If accept
is true
the connection is valid and the user is logged in. Else error
has an error string and the connection to the server will be terminated after the server answered.
GUI:
write: "signup" username new_password
CLI:
{
"command": "signup",
"accept": bool,
"error": string
}
If accept
is true
the connection is valid and the user is logged in and signed up. Else error
has an error string and the connection to the server will be terminated after the server answered.
Commands can be sent by the client after a connection has been negotiated (See 1). Commands can be used unrelated to each other.
GUI:
write: "status"
CLI:
{
"command": "status",
"response": string
}
list
to request a list download.
GUI:
write: "list"
CLI:
{
"command": "list",
"accept": bool,
"names": string[],
"error": string
}
Put is split in two commands. put
to request a file upload and putdata
to get the information about an ongoing upload.
GUI:
write: "put" file_path
CLI:
{
"command": "put",
"accept": bool,
"file": string,
"error": string
}
If accept
is true
the connection is valid and the client can start sending the file. Else the put request was rejected and is hereby canceled. error
should contain an error string if the request was rejected.
CLI:
{
"command": "putdata",
"file": string,
"cancel": bool,
"error": string
}
If cancel
is true
then the upload of the file is canceled and an error message should be in error
.
Get is split in two commands. get
to request a file download and getdata
to get the information about an ongoing download.
GUI:
write: "get" file_path
CLI:
{
"command": "get",
"accept": bool,
"file": string,
"error": string
}
If accept
is true
the connection is valid and the server can start sending the file. Else the get request was rejected and is hereby canceled. error
should contain an error string if the request was rejected.
CLI:
{
"command": "getdata",
"file": string,
"cancel": bool,
"error": string
}
If cancel
is true
then the download of the file is canceled and an error message should be in error
.
Requests the deletion of a file from the server.
GUI:
write: "deletefile" file_name
CLI:
{
"command": "deletefile",
"file": string,
"accept": bool,
"error": string
}
If accept
is true
the command is valid and the server has deleted the file. Else the request was rejected no changes have been made. error
should contain an error string in that case.
The deleteme
command allows a logged in user to delete their account on the server. This action needs to be confirmed with the users password.
GUI:
write: "deleteme" password
CLI:
{
"command": "deleteme",
"accept": bool,
"error": string
}
If accept
is true the user has been deleted and the connection will be closed by the server.
The notifications
command allows the logged in user to get a list of notifications since the last time.
GUI:
write: "notifications"
CLI:
{
"command": "notifications",
"accept": bool,
"messages": string[],
"error": string
}
The extendedstatus
command allows the client to request detailed information about ongoing transfers at the server.
GUI:
write: "extendedstatus"
CLI:
{
"command": "extendedstatus",
"accept": bool,
"error": string,
"transfersclientserver": {
"upload": bool,
"file": string,
"progress": float
}[],
"transfersserverserver": {
"type": string,
"file": string,
"progress": float,
"speed": float,
"method": string
}[]
}
The answer consists of an array of objects, each representing a transfer.
In case of client-server transfers, upload
indicates wether the transfer is an up- or download. In case of server-server transfers, type
indicates wether the file is upload
ing, download
ing or queued
for upload.
file
contains the name of the file being transferred.
progress
contains the percentage completed.
speed
contains the speed in bytes per second.
method
contains the covert channel method being used.
To add a file that is already on the server to the queue for sending with the covert channel, the use the queue
command.
Client:
write: "queue" file_name
CLI:
{
"command": "queue",
"file": string,
"accept": bool,
"error": string
}
To remove a file from the queue for sending with the covert channel, the use the dequeue
command.
Client:
write: "dequeue" file_name
CLI:
{
"command": "dequeue",
"file": string,
"accept": bool,
"error": string
}
GUI:
write: "extendedlist"
CLI:
{
"command": "extendedlist",
"accept": bool,
"files": {
"name": string,
"encrypted": string,
"size": float
}[],
"error": string
}
The list contains the name
of a file and its size
in kByte.
The encrypted
field contains information wether the file is unknown
in case of bad signature or file size, unencrypted
, decryptable
or undecryptable
.
GUI:
write: "disconnect"
CLI:
{
"command": "disconnect",
"accept": bool
}
If accept
is true, the connection is closed and it is possible to connect to another server.
GUI:
write: "exit"
If the CLI is not connected, the program can exit directly. Otherwise, the CLI sends a disconnect reply first:
CLI:
{
"command": "disconnect",
"accept": bool
}
If accept
is true, the connection is closed and the program can exit.
If an unexpected error occurs, the GUI might receive an error
message:
{
"command": "error",
"error": string
}
If the server does not respond to requests for some time, the GUI receives a connectionerror
message and the the connection to the server is terminated:
{
"command": "connectionerror",
"error": string
}