📦 Event-driven RADIUS server supporting LTS Node versions
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.codeclimate.yml
.editorconfig
.gitignore
.npmignore
.nvmrc
.travis.yml
LICENSE
README.md
index.js
package-lock.json
package.json

README.md

tephra Build Status Code Climate Test Coverage Issue Count Known Vulnerabilities

tephra, n: rock fragments and particles ejected by a volcanic eruption

an evented radius server based on node-radius - now it's easier than ever to write a radius server that isn't standards-compliant! ;)

example

var users = {'joe-bloggs': 'secret-password'}
var tephra = require('tephra')
var server = new tephra(
  'shared_secret',
  1812, // authentication port
  1813, // accounting port
  1814 // change of authorisation port
)

server.on('Access-Request', function(packet, rinfo, accept, reject) {
  var username = packet.attributes['User-Name'],
      password = packet.attributes['User-Password']
  if (username in users && users[username] === password) {
    return accept(
      [/* attributes */],
      [/* vendor attributes */],
      console.log
    )
  }
  reject(
    [/* attributes */],
    [/* vendor attributes */],
    console.log
  )
}).on('Accounting-Request', function(packet, rinfo, respond) {
  // catch all accounting-requests
  respond(
    [/* attributes */],
    [/* vendor attributes */],
    console.log
  )
}).on('Accounting-Request-Start', function(packet, rinfo, respond) {
  // or just catch specific accounting-request status types...
  respond(
    [/* attributes */],
    [/* vendor attributes */],
    console.log
  )
}).on('Accounting-Request-Interim-Update', function(packet, rinfo, respond) {
  respond(
    [/* attributes */],
    [/* vendor attributes */],
    console.log
  )
}).on('Accounting-Request-Stop', function(packet, rinfo, respond) {
  respond(
    [/* attributes */],
    [/* vendor attributes */],
    console.log
  )
}).bind()

notes

  • since we're supporting all lts versions, we can't use arrow functions (and perhaps some other features, too) until node 4 is out of maintenance period.