Wondering what’s next for npm?Check out our public roadmap! »

    @rojo2/turn-credentials

    1.0.1 • Public • Published

    @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

    Install

    npm i @rojo2/turn-credentials

    DownloadsWeekly Downloads

    6

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    13.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar
    • avatar