How stekohl/janus-gateway works
Janus is a general-purpose WebRTC server. A client sends API requests through a configured transport; the core routes sessions and plugin requests, while media negotiation and packet handling use the WebRTC protocol stack. Plugins provide distinct services such as conferencing, streaming, calling, messaging, and recording. The README documents additional API transports, event handlers, and post-processing capabilities. Source excerpts are partial, so links for unsampled subsystems follow documented roles and the repository’s module boundaries.
Main entry points: plugin.h Plugin interface · janus.c Janus core · janus.js Janus JS API · dtls.c DTLS and SRTP
Components 26
Client interface
- Janus JS API
html/demos/janus.js - Browser peer connection
Gateway core
- API transports
src/transports/transport.h - HTTP transport
src/transports/janus_http.c - WebSocket transport
src/transports/janus_websockets.c - Janus core
src/janus.c - Request authentication
src/auth.c - Plugin interface
src/plugins/plugin.h - Event dispatch
src/events.c
Media stack
- ICE connectivity
src/ice.c - DTLS and SRTP
src/dtls.c - SDP negotiation
src/sdp.c - RTP and RTCP
src/rtp.c - Data channels
src/sctp.c
Plugins and services
- Event handlers
src/events/eventhandler.h - AudioBridge
src/plugins/janus_audiobridge.c - VideoRoom
src/plugins/janus_videoroom.c - Streaming
src/plugins/janus_streaming.c - SIP gateway
src/plugins/janus_sip.c - VideoCall
src/plugins/janus_videocall.c - TextRoom
src/plugins/janus_textroom.c - Recording playback
src/plugins/janus_recordplay.c - Recording helper
src/record.c - Recording post-processing
src/postprocessing/janus-pp-rec.c
Other components
- WebRTC client
- External event sinks
Connections 25
- WebRTC client → Janus JS API: uses
- Janus JS API → HTTP transport: sends API requests
- Janus JS API → WebSocket transport: sends API requests
- Janus JS API → Browser peer connection: creates peer connection
- HTTP transport → Janus core: dispatches requests
- WebSocket transport → Janus core: dispatches requests
- Janus core → Request authentication: checks credentials
- Janus core → Plugin interface: dispatches plugin requests
- Janus core → ICE connectivity: manages connectivity
- Janus core → Event dispatch: emits notifications
- Plugin interface → AudioBridge: implements service
- Plugin interface → VideoRoom: implements service
- Plugin interface → Streaming: implements service
- Plugin interface → SIP gateway: implements service
- Plugin interface → VideoCall: implements service
- Plugin interface → TextRoom: implements service
- Plugin interface → Recording playback: implements service
- ICE connectivity → DTLS and SRTP: negotiates secure transport
- DTLS and SRTP → SDP negotiation: secures negotiated media
- DTLS and SRTP → RTP and RTCP: protects media packets
- DTLS and SRTP → Data channels: secures data channels
- Event dispatch → Event handlers: notifies handlers
- Event handlers → External event sinks: forwards events
- AudioBridge → Recording helper: records media
- Recording post-processing → Recording helper: processes recordings