Skip to content

rojo2/turn-credentials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Aitor Moreno
Oct 20, 2020
f3941ce · Oct 20, 2020

History

2 Commits
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020
Oct 20, 2020

Repository files navigation

@rojo2/turn-credentials

A library to create TURN credentials RFC.

import turnCredentials from '@rojo2/turn-credentials'

const credentials = turnCredentials('username', {
  secret: process.env.TURN_SECRET
})

How to test it against a running TURN server

Installing it as a global dependency

npm i -g @rojo2/turn-credentials
turn-credentials <userName> <secret>

This small CLI program returns a JSON with two properties username and credential, this can be piped into a program like jq and the finally use it with testing utilities like turnutils_uclient (you can find it in coTURN).

for s in $(turn-credentials <userName> <secret> | jq -r "to_entries|map(\"turn_\(.key|tostring)=\(.value|tostring)\")|.[]" ); do
  export $s
done
turnutils_uclient -t -v -y -X -M -p 443 -u $turn_username -w $turn_credential -W <secret> <TURN server>

Made with ❤️ by rojo2

About

TURN credentials factory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published