You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Hans-Peter Herzog 1a6e1d3055
TT#2723 Lock npm deps
9 years ago
debian TT#4931 Initial empty package to start using Jenkins on Gerrit 9 years ago
src TT#5036 Add method removeAllTokens 9 years ago
test TT#5036 Add method removeAllTokens 9 years ago
.editorconfig TT#5036 Create http client to access janus admin api 9 years ago
.gitignore TT#5036 Create http client to access janus admin api 9 years ago
.gitreview TT#4931 Add .gitreview 9 years ago
Makefile TT#4931 Initial empty package to start using Jenkins on Gerrit 9 years ago
README.md TT#2723 Javascript syntax highlighting in README 9 years ago
npm-shrinkwrap.json TT#2723 Lock npm deps 9 years ago
package.json TT#2723 Lock npm deps 9 years ago

README.md

JanusAdmin

JanusAdmin is a node.js http client, that implements the entire admin interface of the Janus WebRTC Gateway.

Usage

var JanusAdmin = require('janus-admin').JanusAdmin;

var admin = new JanusAdmin({
    url: 'http://janus-admin:7088',
    secret: '*****'
});

Methods

List sessions

admin.listSessions().then((res)=>{
    console.log(res.sessions)
}).catch((err)=>{
    ...
});

List handles

admin.listHandles(sessionId).then((res)=>{
    console.log(res.handles)
}).catch((err)=>{
    ...
});

Show single handle

admin.handleInfo(sessionId, handleId).then((res)=>{
    console.log(res.info)
}).catch((err)=>{
    ...
});

Set the log level

admin.setLogLevel([0...7]).then((res)=>{
    console.log(res.level)
}).catch((err)=>{
    ...
});

Set locking debug

admin.setLockingDebug([0,1]).then((res)=>{
    console.log(res.debug)
}).catch((err)=>{
    ...
});

Methods (token based authentication)

Add token

admin.addToken(token).then((res)=>{
    console.log(res.plugins);
}).catch((err)=>{
    ...
});

Allow token

admin.allowToken(token, plugins).then((res)=>{
    console.log(res.plugins);
}).catch((err)=>{
    ...
});

Disallow token

admin.disallowToken(token, plugins).then((res)=>{
    console.log(res.plugins);
}).catch((err)=>{
    ...
});

List all tokens

admin.listTokens().then((res)=>{
    console.log(res.tokens);
}).catch((err)=>{
    ...
});

Remove token

adminClient.removeToken(token).then((res)=>{
    ...
}).catch((err)=>{
    ...
});

Remove all tokens

adminClient.removeAllTokens().then((res)=>{
    ...
}).catch((err)=>{
    ...
});