ClipboardLan Protocol Specification =================================== Attention! Every line must end with . === COMMANDS === LOGIN hash Connects both endpoints. [Arguments] hash: sha1-hashed passphrase. [Examples] LOGIN da39a3ee5e6b4b0d3255bfef95601890afd80709 202 Accepted Authentication succeed! LOGIN da39a3ee5e6b4b0d3255bfef95601890afd80709 401 Unauthorized Authentication failed! LOGIN da39a3ee5e6b4b0d3255bfef95601890afd80709 503 Service Unavailable This host is currently paired with another. -- PING Checks connection status. [Examples] PING 200 PONG OK, connection is alive. PING (No response in 15 seconds) Connection was closed or lost. -- VERSION Returns version of the procotol accepted by the server. [Example] VERSION 101 Current protocol version is: 2.0.0 Server protocol version follows. -- CAPABILITIES [type] Return a list of types accepted by the host. [Examples] CAPABILITIES 101 Capability list: TEXT PICTURE FILE BINARY . (The list finishes with a ".") CAPABILITIES TEXT 202 Supported CAPABILITIES VIDEO 405 Not Supported. Send as BINARY -- TRANSFER type size [parameter] Transfer the content. Depending on the type, additional request could be made. [Examples] [Typical session] TRANSFER TEXT 13 101 Send data after this message Hello World! 200 Received correctly [The other endpoint rejected the transfer] TRANSFER FILE 156 "filename.zip" 101 Send data after this message (Binary data goes here) 440 Aborted [Using types we cannot understand] TRANSFER UNKNOWN 3442 405 Not Supported. Try again as BINARY TRANSFER BINARY 3442 101 Send data after this message (Binary data goes here) 200 Received correctly [Not logged user] TRANSFER PICTURE 3442 401 Unauthorized In the future, we might change this schema because of the lack of proper way to check for errors. We might add an CRC checking. -- QUIT 205 Bye! Close the current connection in both sides. -- === Rules === Instances are connected in pairs. You can't connect three machines currently. It is not allowed to run more than a single instance of the application. If three instances are opened at the same time, the behavior is not defined. It must be possible to state clearly which machine we want to connect (if there are any doubt).