libjingle is a collection of open-source C++ code and sample applications that enables you to build a peer-to-peer application. The code handles creating a network connection (through NAT and firewall devices, relay servers, and proxies), negotiating session details (codecs, formats, etc.), and exchanging data. It also provides helper tasks such as parsing XML, and handling network proxies. You could build the following programs with libjingle:
libjingle is available on Google Code for both Windows and UNIX/Linux operating systems. This documentation supplements the readme files included with the code.
We are providing this source code as part of our ongoing commitment to promoting consumer choice and interoperability in Internet-based real-time-communications. This code is made available under a Berkeley-style license, which means you are free to incorporate it into commercial and non-commercial software and distribute it.
The libjingle SDK consists of C++ source code and documentation that enable you to design applications that connect and exchange data across a network (peer to peer data connections). The SDK contains code and sample applications, a Visual Studio 2005 solution file for compiling on Windows computers, configuration and makefiles for other operating systems and compilers, and compilation instructions. Note that the code has some external dependencies (for instance, the voice chat sample has dependencies on Linphone or GIPS VoiceEngine Lite, depending on your platform). Dependencies are indicated in the code and the build instructions.
The code includes network and proxy negotiation classes, XML parsing classes, a STUN server, and all the code required to initiate connections and exchange data between two computers. The connection code enables applications to robustly traverse NAT and firewall devices using the ICE mechanism, to use STUN servers, and to exchange either UDP or TCP data packets. You can use the code as provided, or extend it fit your own specific needs, according to the Berkeley-style license.
libjingle was created at about the same time as the Jingle XMPP extension (XEP-0166). The libjingle team created their own protocol to handle session negotiation, and later worked with the XMPP Standards Foundation to standardize Jingle; thus, although the libjingle protocol and Jingle are very similar, they are not the same, and are not interoperable.
The current version of the libjingle code still uses the original internal protocol, which is slightly different from, and incompatible with, the Jingle specification. Nevertheless, it is close enough to Jingle that it is worthwhile learning the Jingle specifications. Similar "close but not identical" conditions exist for libjingle's audio content description (early version of Jingle Audio Content Description Format XEP-0167), ICE transport description (early version of Jingle Ice Transport XEP-0176), and raw UDP transport description (early version of Jingle Raw UDP transport description XEP-0177). Where this documentation refers to "Jingle" or one of its related extensions (in terms of how libjingle uses that protocol), it really refers to the original, internal protocol
The libjingle team intends to implement the official Jingle extension in libjingle (while making libjingle backward compatible for the current custom version).
In order to use libjingle, you should be familiar with the XMPP protocol, general networking concepts, and C++. Additionally, it helps to be familiar with the Jingle proposed extension (XEP-0166), and other related extensions listed in Jingle and libjingle above.
The requirements to build and use libjingle are given in Creating a libjingle Application.
This documentation includes the following main topics:
The libjingle SDK contains the following folders.
Directory | Description |
---|---|
base/ | Classes for low-level base functionality such as sockets and threads. Both the p2p and session components depend on these classes. |
examples/ | Contains two sample applications built on libjingle: call, and file share. There are other files in this directory, but they are used for helper applications. |
p2p/ | Classes in libjingle's Peer to Peer component, which negotiate, establish, and maintain peer-to-peer connections through almost any network configuration regardless of NAT-enabled devices and firewalls. |
session/ | Classes that specializes the behavior of the basic peer to peer session according to what type of data is being exchanged (for example, voice or files). |
third_party/ | The default folder to hold various third-party extensions needed by the code. For example, Linphone and GIPS VoiceEngine Lite files should be installed here to use in the voice chat sample application. |
xmllite/ | Classes for parsing and building XMPP stanzas. |
xmpp/ | Classes for sending and receiving XMPP requests, and managing common XMPP server tasks (such as logging in or announcing presence). |
Notes libjingle has some issues you should be aware of: