Protocol

Window Switch uses a very simple line based message exchange for all communications between client and server.
This makes it very easy to observe with the usual set of network packet capture tools, the clients and the server also support regular expressions which will log any messages (sent or received) that match it: simply start with the option --trace-protocol-message=RE
It also makes it possible to access it using telnet or netcat.
The sockets used for communication can be automatically discovered using mDNS.

Here are the message formats and their purpose:
Message Type Message Parameters Purpose From Server From Client
ping none test the connection star star
OK none Sent in response to ping star star
NOK none Sent if any error occurred or the command was not recognised star star
help none display help message star star
User Commands
add_user username, password, uuid, etc Login to the server or add a user to the client star star
remove_user uuid Remove user (no longer available) star star
logout none Logout star star
authentication_failed message Tell the client that login failed star star
authentication_success message Tell the client that login succeeded star star
send_message uuid, message Send a message to another user star star
request_user_icon uuid Request the user's avatar icon star star
set_user_icon uuid, icon data Send the user's avatar icon star star
Session Commands
add_session ID, name, command, display, status... Add a session to the client's list star star
start_session command, name, session type... Start a new session on the server star star
shadow_session display, read_only Start a shadow session of an existing session star star
open_file filename Open a file on the server star star
remove_session ID Removes a session from the client's list star star
send_session ID, user, [password] Send a session to a user star star
request_session ID Request access to the session star star
kill_session ID Force the session to terminate star star
close_session ID Close the session star star
set_session_status ID, status, actor Modify the session's state star star
request_session_icon ID Request the session's icon star star
set_session_icon ID, icon data Set the session's icon star star
Menu Commands
add_server_command ID, command, name Add a command to the menu list star star
request_command_icon ID Request the commmand's icon star star
set_command_icon ID, icon data Send the commmand's icon star star
System Messages
sync none Request synchronisation of data star star
sync_end none Sent after all the data star star
version version number Information about the software version star star
set_salt salt Sets the salt which must be used for signing/authentication star star
set_remote_key key, signature, signed salt, etc The client or server's credentials star star
set_host_info name, type, etc Supplemental information about the host star star
set_tunnel_ports list of ports Ports that the client must use for tunnelling star star
set_xmodmap xmodmap The keyboard mappings for this user star star