Skip to content

Quick start ​

Build the server, give it a four-line config, and talk to it with curl. About ten minutes, most of it compiling.

You need ​

ToolVersionUsed for
Rust1.91 or newer (edition 2024)building the server
A C compilerApple clang, gcc or clangthe Opus and Lua bindings, which ADR-0007 and ADR-0008 allow to compile C
Node.js20 or newerthe Bench test console and these docs, not the server
Chromeany recentthe headless end-to-end run, optional
Dockeranythe C oracle for parity captures, optional

The C oracle (the original server at commit bc0de3b3) is only needed for parity work. You can run everything on this page without it.

1. Build ​

sh
git clone https://github.com/januscaler/janus-server-rust.git
cd janus-server-rust
cargo build -p janus --features "plugin-echotest plugin-videoroom plugin-videocall plugin-streaming plugin-recordplay plugin-textroom plugin-audiobridge plugin-nosip plugin-sip"

The binary is target/debug/janus. A plain cargo build -p janus builds only EchoTest and RecordPlay, because each plugin is a Cargo feature (the C build's --enable-* flags). See Build and run for the feature list and the release build.

2. Write a config ​

The server reads its configuration from a folder, one .jcfg file per component. Make the smallest useful one:

sh
mkdir -p conf
cat > conf/janus.jcfg <<'CFG'
general: {
	admin_secret = "janusoverlord"
}
CFG
cat > conf/janus.transport.http.jcfg <<'CFG'
general: {
	http = true
	port = 8088
}
admin: {
	admin_http = true
	admin_port = 7088
}
cors: {
	allow_origin = "*"
}
CFG
cat > conf/janus.transport.websockets.jcfg <<'CFG'
general: {
	ws = true
	ws_port = 8188
}
CFG
cat > conf/janus.plugin.videoroom.jcfg <<'CFG'
room-1234: {
	description = "Demo Room"
	secret = "adminpwd"
	publishers = 6
}
CFG

The Admin API is off by default, so admin_http = true turns it on. cors.allow_origin lets a browser app on another port, such as the Bench, call the server. Every key is in the config reference.

3. Start the server ​

sh
target/debug/janus --configs-folder=$PWD/conf

It prints the banner, the config it read, the plugins it registered and the ports it opened, and stays in the foreground. Look for these lines:

text
HTTP webserver started (port 8088, /janus path listener)...
Admin/monitor HTTP webserver started (port 7088, /admin path listener)...
WebSockets server started (port 8188)...

A minimal config also works

With no janus.jcfg at all the server logs an error about the missing file, goes on with defaults and command-line options, and still opens the transports that have their own file. Verified by starting it with only janus.transport.http.jcfg.

4. Say hello ​

Ask the server about itself:

sh
curl -s http://127.0.0.1:8088/janus/info

Create a session, attach the VideoRoom plugin, and list the rooms. Replace the two ids with the ones the server returns:

sh
curl -s -X POST http://127.0.0.1:8088/janus -d '{"janus":"create","transaction":"t1"}'
curl -s -X POST http://127.0.0.1:8088/janus/SESSION_ID -d '{"janus":"attach","plugin":"janus.plugin.videoroom","transaction":"t2"}'
curl -s -X POST http://127.0.0.1:8088/janus/SESSION_ID/HANDLE_ID -d '{"janus":"message","transaction":"t3","body":{"request":"list"}}'

The last reply lists room 1234. The same exchange, recorded from the binary, is in the Janus API walkthrough.

Ask the Admin API what is connected:

sh
curl -s -X POST http://127.0.0.1:7088/admin -d '{"janus":"list_sessions","transaction":"a1","admin_secret":"janusoverlord"}'

5. Try real media ​

Curl cannot negotiate WebRTC. Use the Janus Bench: a browser app that publishes a test tone and a test pattern to EchoTest, VideoRoom and the rest, and says pass or fail for each.

sh
cd webapp
npm install
npm run dev

Open the address Vite prints, press Run all checks, and read the results page to know what to expect.

Where next ​

GPL-3.0-or-later, like the Janus gateway it ports.