1 | # freeice
|
2 |
|
3 | The `freeice` module is a simple way of getting random STUN or TURN server
|
4 | for your WebRTC application. The list of servers (just STUN at this stage)
|
5 | were 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 |
|
14 | The following demonstrates how you can use `freeice` with
|
15 | [rtc-quickconnect](https://github.com/rtc-io/rtc-quickconnect):
|
16 |
|
17 | ```js
|
18 | var freeice = require('freeice');
|
19 | var quickconnect = require('rtc-quickconnect');
|
20 |
|
21 | // initialise a configuration for one stun server
|
22 | var qcOpts = {
|
23 | room: 'icetest',
|
24 | iceServers: freeice()
|
25 | };
|
26 |
|
27 | // go ahead and connect
|
28 | quickconnect('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 |
|
42 | As the `freeice` module generates ice servers in a list compliant with the
|
43 | WebRTC spec you will be able to use it with raw `RTCPeerConnection`
|
44 | constructors and other WebRTC libraries.
|
45 |
|
46 | ## Hey, don't use my STUN/TURN server!
|
47 |
|
48 | If 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
|
50 | free to open an issue on this repository and those servers will be removed
|
51 | within 24 hours (or sooner). This is the quickest and probably the most
|
52 | polite way to have something removed (and provides us some visibility
|
53 | if someone opens a pull request requesting that a server is added).
|
54 |
|
55 | ## Please add my server!
|
56 |
|
57 | If you have a server that you wish to add to the list, that's awesome! I'm
|
58 | sure I speak on behalf of a whole pile of WebRTC developers who say thanks.
|
59 | To get it into the list, feel free to either open a pull request or if you
|
60 | find that process a bit daunting then just create an issue requesting
|
61 | the addition of the server (make sure you provide all the details, and if
|
62 | you have a Terms of Service then including that in the PR/issue would be
|
63 | awesome).
|
64 |
|
65 | ## I know of a free server, can I add it?
|
66 |
|
67 | Sure, if you do your homework and make sure it is ok to use (I'm currently
|
68 | in the process of reviewing the terms of those STUN servers included from
|
69 | the original list). If it's ok to go, then please see the previous entry
|
70 | for 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
|
78 | exports.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
|
101 | exports.turn = [
|
102 | ];
|
103 | ```
|
104 |
|
105 | ## License(s)
|
106 |
|
107 | ### MIT
|
108 |
|
109 | Copyright (c) 2014 Damon Oehlman <damon.oehlman@gmail.com>
|
110 |
|
111 | Permission is hereby granted, free of charge, to any person obtaining
|
112 | a copy of this software and associated documentation files (the
|
113 | 'Software'), to deal in the Software without restriction, including
|
114 | without limitation the rights to use, copy, modify, merge, publish,
|
115 | distribute, sublicense, and/or sell copies of the Software, and to
|
116 | permit persons to whom the Software is furnished to do so, subject to
|
117 | the following conditions:
|
118 |
|
119 | The above copyright notice and this permission notice shall be
|
120 | included in all copies or substantial portions of the Software.
|
121 |
|
122 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
123 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
124 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
125 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
126 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
127 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
128 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|