UNPKG

4.29 kBMarkdownView Raw
1# freeice
2
3The `freeice` module is a simple way of getting random STUN or TURN server
4for your WebRTC application. The list of servers (just STUN at this stage)
5were sourced from this [gist](https://gist.github.com/zziuni/3741933).
6
7
8[![NPM](https://nodei.co/npm/freeice.png)](https://nodei.co/npm/freeice/)
9
10[![Build Status](https://travis-ci.org/DamonOehlman/freeice.png?branch=master)](https://travis-ci.org/DamonOehlman/freeice)
11
12## Example Use
13
14The following demonstrates how you can use `freeice` with
15[rtc-quickconnect](https://github.com/rtc-io/rtc-quickconnect):
16
17```js
18var freeice = require('freeice');
19var quickconnect = require('rtc-quickconnect');
20
21// initialise a configuration for one stun server
22var qcOpts = {
23 room: 'icetest',
24 iceServers: freeice()
25};
26
27// go ahead and connect
28quickconnect('http://rtc.io/switchboard', qcOpts)
29 .createDataChannel('chat')
30 .once('chat:open', function(dc, peerId) {
31 console.log('data channel opened for peer id: ' + peerId);
32
33 dc.onmessage = function(evt) {
34 console.log('peer ' + peerId + ' says: ' + evt.data);
35 };
36
37 dc.send('hi');
38 });
39
40```
41
42As the `freeice` module generates ice servers in a list compliant with the
43WebRTC spec you will be able to use it with raw `RTCPeerConnection`
44constructors and other WebRTC libraries.
45
46## Hey, don't use my STUN/TURN server!
47
48If for some reason your free STUN or TURN server ends up in the
49[list](servers.js) of servers that is used in this module, you can feel
50free to open an issue on this repository and those servers will be removed
51within 24 hours (or sooner). This is the quickest and probably the most
52polite way to have something removed (and provides us some visibility
53if someone opens a pull request requesting that a server is added).
54
55## Please add my server!
56
57If you have a server that you wish to add to the list, that's awesome! I'm
58sure I speak on behalf of a whole pile of WebRTC developers who say thanks.
59To get it into the list, feel free to either open a pull request or if you
60find that process a bit daunting then just create an issue requesting
61the addition of the server (make sure you provide all the details, and if
62you have a Terms of Service then including that in the PR/issue would be
63awesome).
64
65## I know of a free server, can I add it?
66
67Sure, if you do your homework and make sure it is ok to use (I'm currently
68in the process of reviewing the terms of those STUN servers included from
69the original list). If it's ok to go, then please see the previous entry
70for how to add it.
71
72## Current List of Servers
73
74* current as at the time of last `README.md` file generation
75
76```js
77// STUN servers
78exports.stun = [
79 'stun.l.google.com:19302',
80 'stun1.l.google.com:19302',
81 'stun2.l.google.com:19302',
82 // 'stun3.l.google.com:19302',
83 'stun4.l.google.com:19302',
84 // 'stun01.sipphone.com',
85 'stun.ekiga.net',
86 // 'stun.fwdnet.net',
87 'stun.ideasip.com',
88 'stun.iptel.org',
89 'stun.rixtelecom.se',
90 'stun.schlund.de',
91 'stunserver.org',
92 'stun.softjoys.com',
93 'stun.voiparound.com',
94 'stun.voipbuster.com'
95 // 'stun.voipstunt.com',
96 // 'stun.voxgratia.org',
97 // 'stun.xten.com'
98];
99
100// TURN servers
101exports.turn = [
102];
103```
104
105## License(s)
106
107### MIT
108
109Copyright (c) 2014 Damon Oehlman <damon.oehlman@gmail.com>
110
111Permission is hereby granted, free of charge, to any person obtaining
112a copy of this software and associated documentation files (the
113'Software'), to deal in the Software without restriction, including
114without limitation the rights to use, copy, modify, merge, publish,
115distribute, sublicense, and/or sell copies of the Software, and to
116permit persons to whom the Software is furnished to do so, subject to
117the following conditions:
118
119The above copyright notice and this permission notice shall be
120included in all copies or substantial portions of the Software.
121
122THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
123EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
124MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
125IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
126CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
127TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
128SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.