/
implementation.tex
44 lines (40 loc) · 2.66 KB
/
implementation.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\section{Implementation}
\subsection{Crossfire Firefox Extension}
The first implementation of the Crossfire protocol is an extension to Firefox
and Firebug. Implemented entirely in JavaScript, it uses a modular design to
allow us to share code between client and server implementations, as well as
cross-browser implementations. The transport layer operates as either a Crossfire
client or server; currently the transport operates over TCP sockets.
Future support for operating over HTTP and/or WebSockets is planned.
The extension can be started in client or server mode either from the Firefox
user interface, or via command-line switches to Firefox. This latter mode of
operation allows external tools to launch Firefox and start the Crossfire server
listening on a known port so that the external tool may automatically connect
back to it.
\subsection{Crossfire Tools API}
To support extensions, \textit{Crossfire} maintains a registry on both the
client and server side as show in Fig.~\ref{fig:crossfire-arch}.
The Crossfire extension also implements an API, called the \textit{Crossfire
Tools API} which enables extensibility of the Crossfire system and protocol.
Firebug features such as the Console, Inspector, and Net Panel, are implemented as tools
using the API, allowing them to be enabled/disabled independently.
A tool can be implemented as a JavaScript file or collection of files that
implements the Crossfire Tools API. The tool registers itself with the core
Crossfire Module, providing an identification string that is used to identify
messages via the 'tool' header. In server operation, the tool is then able to
receive notification when a connection is created or when request packets are
received. The Tools API allows a tool to access Crossfire's transport layer in
order to send events or command responses. Typically, a tool operating within
the context of a Crossfire server might register listeners with one or more
Firebug modules, in order to dispatch events generated by the module to the
remote connection. A tool operating as part of a Crossfire client would process
the events sent from the server tool, and update part of the client UI, such as
a Firebug panel. The tool could also listen for client events from the UI, and
send the appropriate requests to the server, to be handled by the tool's
server-side component.
\begin{figure}[htp]
\includegraphics [width = 86 mm] {figures/crossfire-arch4.png}
\caption{Crossfire Extension Architecture. The Crossfire Module running in both client and server
load extension modules which register 'tools', one half in the Server Tools registry and the other half in the Client Tools registry. }
\label{fig:crossfire-arch}
\end{figure}