Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nicojanssens/turn-js
TURN (Traversal Using Relay NAT) library written entirely in JavaScript
https://github.com/nicojanssens/turn-js
relay-nat rfc-5766 turn
Last synced: 21 days ago
JSON representation
TURN (Traversal Using Relay NAT) library written entirely in JavaScript
- Host: GitHub
- URL: https://github.com/nicojanssens/turn-js
- Owner: nicojanssens
- License: mit
- Created: 2015-12-11T21:29:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T20:53:41.000Z (3 months ago)
- Last Synced: 2025-01-03T03:11:57.220Z (26 days ago)
- Topics: relay-nat, rfc-5766, turn
- Language: JavaScript
- Size: 126 KB
- Stars: 28
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nodejs-pure-js - turn-js
README
[![CircleCI](https://circleci.com/gh/MicroMinion/turn-js.svg?style=shield)](https://circleci.com/gh/MicroMinion/turn-js)
[![npm](https://img.shields.io/npm/v/turn-js.svg)](https://npmjs.org/package/turn-js)# Turn-JS
#### TURN (Traversal Using Relay NAT) library written entirely in JavaScript.## Features
- implements (most of) the features specified in [RFC 5766](https://tools.ietf.org/html/rfc5766)
- supports TCP and UDP communication
- offers callback and promise based API
- can be browserified (to be used in chrome apps)## Install
```
npm install turn-js
```## Usage
### Callbacks
### Promises
## API
### `myClient = turn(serverAddr, serverPort, user, pwd, transport)`
### `myClient.allocate(function(address) {}, function(error) {})`
### `myClient.allocateP()`
### `myClient.createPermission(address, function() {}, function(error) {})`
### `myClient.createPermission(address)`
### `myClient.bindChannel(address, port, channel, lifetime, function() {}, function(error) {})`
### `myClient.bindChannelP(address, port, channel)`
### `myClient.refresh(lifetime, function() {}, function(error) {})`
### `myClient.refreshP(lifetime)`
### `myClient.close(function() {}, function(error) {})`
### `myClient.sendToRelay(bytes, address, port, function() {}, function(error))`
### `myClient.sendToRelayP(bytes, address, port)`
### `myClient.sendToChannel(bytes, channel, function() {}, function(error) {})`
### `myClient.sendToChannelP(bytes, channel)`
## Events