Skip to main content

XMPP Signaling

lib-jitsi-meet uses XMPP with the Jingle extension (XEP-0166) for WebRTC signaling. The library implements this using Strophe.js with custom plugins.

Architecture Overview

The XMPP signaling layer consists of:
  • Strophe.js - Core XMPP client library (Jitsi fork)
  • JingleConnectionPlugin - Handles Jingle session management
  • JingleSessionPC - Manages individual peer connections
  • Strophe Plugins - Protocol extensions (disco, jingle, etc.)
  • SignalingLayer - Abstraction for protocol details
Source: CLAUDE.md:94-99

Jingle Protocol

Jingle (XEP-0166) is an XMPP extension for establishing peer-to-peer media sessions.

Session Lifecycle

1. Session Initiate
Source: modules/xmpp/strophe.jingle.js:181-200 2. Session Accept
Source: modules/xmpp/strophe.jingle.js:202-214 3. Transport Info ICE candidates are exchanged via transport-info actions:
Source: modules/xmpp/strophe.jingle.js:221-226 4. Session Terminate
Source: modules/xmpp/strophe.jingle.js:228-245

Source Signaling

Source Add
Source: modules/xmpp/strophe.jingle.js:250-252 Source Remove
Source: modules/xmpp/strophe.jingle.js:253-255

P2P vs JVB Detection

lib-jitsi-meet distinguishes P2P from JVB connections by checking the resource:
Jicofo (the JVB focus component) always has the resource “focus”, while P2P connections use participant resources. Source: modules/xmpp/strophe.jingle.js:152

JSON Message Encoding

For large conferences, lib-jitsi-meet uses JSON encoding to compress source information:
Source: modules/xmpp/strophe.jingle.js:156-174

ICE Candidate Parsing

ICE candidates are extracted from transport elements:
Source: modules/xmpp/strophe.jingle.js:26-44

Session Management

Creating P2P Sessions

Source: modules/xmpp/strophe.jingle.js:277-292

Session Validation

Session Not Found
Source: modules/xmpp/strophe.jingle.js:99-114 JID Mismatch
Source: modules/xmpp/strophe.jingle.js:117-132

Strophe.js Integration

lib-jitsi-meet uses a custom fork of Strophe.js with Jitsi-specific modifications.

Connection Plugin Pattern

Source: modules/xmpp/strophe.jingle.js:49-78

IQ Acknowledgment

All Jingle IQs must be acknowledged:
Source: modules/xmpp/strophe.jingle.js:91-94, 265-267

Media Constraints

Default media constraints for Jingle sessions:
Source: modules/xmpp/strophe.jingle.js:64-67

ICE Configuration

Separate ICE configurations for JVB and P2P:
ICE config is cloned before use to prevent mutation:
Source: modules/xmpp/strophe.jingle.js:62-63, 194

Strophe Plugins

lib-jitsi-meet includes several Strophe plugins for XMPP protocol extensions:

Available Plugins

  • strophe.jingle.js - Jingle session management (XEP-0166)
  • strophe.disco.js - Service discovery (XEP-0030)
  • moderator.js - Moderator functionality
  • Lobby.js - Lobby/waiting room support
  • BreakoutRooms.js - Breakout room management
Source: modules/xmpp/ directory listing

Plugin Architecture

All plugins extend ConnectionPlugin:
Source: modules/xmpp/strophe.jingle.js:9, 49

XMPP Events

The Jingle plugin emits events via the EventEmitter:
Source: modules/xmpp/strophe.jingle.js:5, 199, 213, 225, 244
Session ID CollisionIf a session-initiate is received with an existing session ID, lib-jitsi-meet rejects it:
This prevents out-of-order message issues.Source: modules/xmpp/strophe.jingle.js:133-146

XML Utilities

lib-jitsi-meet provides XML helpers for parsing Jingle IQs:
Source: modules/xmpp/strophe.jingle.js:7, 85-88, 239

XMPP Connection Management

The signaling layer is part of the broader XMPP architecture: Module Structure
  • ChatRoom.js - Multi-user chat room with presence
  • JingleSessionPC.js - Jingle protocol for media negotiation
  • SignalingLayerImpl.js - Abstraction layer for signaling
  • Strophe plugins - Protocol extensions
Transport Support
  • BOSH (Bidirectional-streams Over Synchronous HTTP)
  • WebSocket
Source: CLAUDE.md:94-99

Performance Considerations

Session Timing
lib-jitsi-meet tracks high-resolution timestamps for session events to measure signaling latency. Source: modules/xmpp/strophe.jingle.js:147, 182 P2P Optimization For P2P sessions, detailed logging is conditional:
Source: modules/xmpp/strophe.jingle.js:184

Next Steps