Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

drachtio-mw-auth-parser

0.1.0 • Public • Published

drachtio-mw-auth-parser Build Status NPM version

drachtio middleware for parsing SIP Authorization header, supporting Digest and Basic authorization

Usage

const Srf = require('drachtio-srf');
const srf = new Srf();
const authParser = require('drachtio-mw-auth-parser') ;
 
srf.connect({...}) ;
 
srf.use(authParser) ;
 
srf.register(( req, res ) => {
  console.log(req.authorization) ;
  /*
    Digest: username="103482",realm="sip.drachtio.org",nonce="df24fd41-4fc5-416f-b163-90f774ca0358" \
      uri="sip:73.15.46.10:6060",algorithm=MD5,response="a4881ad854cc0677158206ac9fa90e3b", \
      qop=auth,nc=00000032,cnonce="ea5cec20"
 
    console.log =>
    {
      scheme: 'digest',
      username: '103482',
      realm: 'sip.drachtio.org',
      nonce: 'df24fd41-4fc5-416f-b163-90f774ca0358',
      uri: 'sip:72.1.46.10:6060',
      algorithm: 'MD5',
      response: 'a4881ad854cc0677158206ac9fa90e3b',
      qop: 'auth',
      nc: '00000032',
      cnonce: 'ea5cec20'
    }
   */
}) ;

install

npm i drachtio-mw-auth-parser

Downloadsweekly downloads

6

version

0.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability