-
Notifications
You must be signed in to change notification settings - Fork 13
Platform API
Jan Odvarko edited this page Aug 18, 2015
·
7 revisions
RDP Inspector (RDPi) is intended to intercept Remote Debugging Protocol (RDP) and show all data sent and received. Implementation of this extension is based on platform API that allows to observe set of events and get all data sent through the wire. Let's see how these API are designed.
RDP communication is based on simple packet exchange and this docs is using following terminology to describe the logic.
- Client - This is usually the front-end consumed by the user (e.g. the Toolbox in Firefox desktop browser).
- Backend - The debuggee the client is connected to (can also be called the server).
- Connection - Ensuring paring of the client and backend. It's responsible for data exchange. There can be more clients to one backend at the same time.
- Packet - RDP communication is based on data messages called packets. The packet is the entity sent or received and responsible for carrying an optional payload.
API for RDP monitoring has been introduced in Firefox 38 (see also bug 1126274).
API goals:
- Get list of existing connections
- Track creation of new connections
- Observe connection close
- Intercept all sent/received packets for specific connection
- Access full packet data (including the payload)
Global events:
-
toolbox-created
- Emitted by globalgDevTools
object when a new Toolbox is opened by the user. The event allows accessing the client object that and consequently the protocol object that fires other events related to packet exchange. -
connect
- Emitted by DebuggerClient object (not on the instance) when a new connection (instance) is about to be connected. This event can be used to track all created connections (created by Toolbox, WebIDE, or any other RDP client).
Client events:
-
connected
- Emitted by instance of DebuggerClient when connection with the server has been established (a hello packet from the server received). This object represents a client for the remote debugging protocol server. This client provides the means to communicate with the server and exchange the packets required by the protocol in a traditional JavaScript API. -
closed
- Emitted by instance of DebuggerClient when the underlying protocol stream is closed.
Transport events:
-
send
- Emitted by -
onPacket
- Emitted by -
onBulkPacket
- Emitted by -
startBulkSend
- Emitted by -
onClosed
- Emitted by