Adium

This page will describe the protocol used by the Adium Remote iPhone program's communication with:

  1. The connection-management server, and
  2. The computer running Adium.

Communication between both ends is encrypted using an SSL connection. The Adium Mac client connects to the Adium server, registers for UPnP/NAT-PMP forwarded ports, and instructs the server what is available. The iPhone application communicates with the server for said information, and then negotiates a connection with the Adium Mac client.

Protocol Format

All messages will be in the generic format through the connection in either direction. During registration with the server, the version of the protocol is reported, allowing this format to change with different versions.

[ NULL byte ][ length, 4 bytes ][ contents, 0…length bytes ]

Since this is basically a streaming connection, using a rigid length check allows us faster and easier parsing without having to monitor message contents at the incoming level.

Message contents are JSON commands with the required attribute type which is a string representing the type of message. Message type depends on what is being sent.

User registration

Each user has an Adium account. This username/password is entered in the Adium Mac client and in the iPhone client.

Connecting

When the Mac client registers, it communicates to the server what availability it has, along with what ports a client may connect on. The server and client maintain the connection, as this is how the server tracks available computers, and allows for either end to be notified of any pertinent changes.

The iPhone client similarly connects to the server to request available computers, however this connection is terminated after the list of servers and their relevant information is delivered. A refresh of the information can be performed by repeating the registration (For example, a "Refresh Computer List" operation).

SSL, compression

Proxying

When the Mac client is behind a strong firewall, no proxying will take place. Thus, UPnP or NAT-PMP are a requirement. A demo application should be used to automate testing.

Mac client connection

iPhone client connection

File Transfer/Direct IM

Message receipt

WebKit

Direct IM / File Transfer requests

Message display/delivery (HTML)

Twitter URL handling

Message Delivery (Outgoing)

Contact List

Errors, dialogs, alerts

Account Management

Voice/video

Settings

Page last modified by zacw, 11 months ago