npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-turn

v0.0.6

Published

STUN/TURN Server

Readme

Node-turn

npm version Build Status Coverage Status Dependencies Status

Node-turn is a STUN/TURN server for Node.JS

Supported RFCs:

https://tools.ietf.org/html/rfc5389 https://tools.ietf.org/html/rfc5766

Installation

Install from NPM.

$ npm install node-turn

Use Node-turn as a standalone server

$ cd ./node_modules/node-turn
$ su
# mkdir /etc/node-turn
# cp ./sample-config.conf /etc/node-turn/node-turn.conf
# chmod 640 /etc/node-turn/node-turn.conf
# touch /var/log/node-turn.log
# chmod 640 /var/log/node-turn.log
# exit
$ vi /etc/node-turn/node-turn.conf
$ npm run start

Use Node-turn as a library

var Turn = require('node-turn');
var server = new Turn({
  // set options
  authMech: 'long-term',
  credentials: {
    username: "password"
  }
});
server.start();

available options

Option | Type | Description ------------------------- | --------------- | --------------- listeningPort | Integer | TURN listener port for UDP (Default: 3478). listeningIps | Array | Listener IP address of relay server. Multiple listeners can be specified.If no IP(s) specified in the config, then all system IPs will be used for listening. relayIps | Array | Relay address (the local IP address that will be used to relay the packets to the peer). Multiple relay addresses may be used.The same IP(s) can be used as both listening IP(s) and relay IP(s). If no relay IP(s) specified, then the turnserver will apply the default policy: it will decide itself which relay addresses to be used, and it will always be using the client socket IP address as the relay IP address of the TURN session (if the requested relay address family is the same as the family of the client socket). externalIps | Object | External IP addres for relay address allocations. This is necessary if running the relay server behind a NAT. By default, the local relay IP is used, if externalIps is a string, then all allocations will use that address for the relayed address, if it's an object, then it takes the form of {"local ip 1": "external ip 1", "local ip 2": "external ip 2", default: "default external IP"} to specify an external IP per local relay IP. A special 'default' key can be set for use with any relay addresses that aren't listed in the object. minPort | Integer | Lower bound of the UDP relay endpoints (Default: 49152). maxPort | Integer | Upper bound of the UDP relay endpoints (Default: 65535). authMech | String | TURN credential mechanism. cf authentification mechanism table lower. By default no credentials mechanism is used (any user allowed). credentials | Object | User accounts for credentials mechanisms. username are object keys containing the password string. realm | String | The realm to be used for the users with long-term credentials mechanism. (Default: 'atlantis-software.net'). debugLevel | String | Server log verbose level. cf debug level table lower (Default: 'ERROR'). maxAllocateLifetime | Integer | the max lifetime, in seconds, allowed for allocations (Default: 3600). defaultAllocatetLifetime | Integer | the default allocation lifetime in seconds (Default: 600). debug | Function | Synchronous function used to log debug information that take debugLevel as first argument and string message as second.

Authentification mechanism

Auth mechanism | Description ------------------------- | --------------- 'none' | disable authentification 'short-term' | to use short-term mechanism (cf https://tools.ietf.org/html/rfc5389#section-10.1) 'long-term' | to use long-term mechanism (cf https://tools.ietf.org/html/rfc5389#section-10.2)

debug level

Debug level | Description ------------------------- | --------------- 'OFF' | nothing is logged 'FATAL' | fatal errors are logged 'ERROR' | errors are logged 'WARN' | warnings are logged 'INFO' | infos are logged 'DEBUG' | debug infos are logged 'TRACE' | traces are logged 'ALL' | everything is logged

Library methods

Method | arguments | Description ------------------------- | ------------------------------------ | --------------- start | none | start the server. stop | none | stop the server. addUser | username (String), password (String) | add a user to credential mechanism. removeUser | username (String) | remove a user from credential mechanism.