瀏覽代碼

Update docs to reflect TURN servers and port 9000 warning

ericz 11 年之前
父節點
當前提交
cd287e2fae
共有 4 個文件被更改,包括 41 次插入15 次删除
  1. 3 3
      docs/api.json
  2. 21 8
      docs/index.html
  3. 1 1
      docs/package.json
  4. 16 3
      docs/template.html

+ 3 - 3
docs/api.json

@@ -19,7 +19,7 @@
           {
             "name": "key",
             "type": "string",
-            "description": "API key for the cloud PeerServer. This is not used for servers other than <code>0.peerjs.com</code>."
+            "description": "API key for the cloud PeerServer. This is not used for servers other than <code>0.peerjs.com</code>.<span class='warn'>PeerServer cloud runs on port 9000. Please ensure it is not blocked or consider running your own PeerServer instead.</span>"
           },
           {
             "name": "host",
@@ -307,7 +307,7 @@
             "name": "'close'",
             "type": "event",
             "snippet": "dataConnection.on('close', function() { ... });",
-            "description": "Emitted when either you or the remote peer closes the data connection."
+            "description": "Emitted when either you or the remote peer closes the data connection.<span class='warn'>Firefox does not yet support this event.</span>"
           },
           {
             "name": "'error'",
@@ -388,7 +388,7 @@
             "name": "'close'",
             "type": "event",
             "snippet": "mediaConnection.on('close', function() { ... });",
-            "description": "Emitted when either you or the remote peer closes the media connection."
+            "description": "Emitted when either you or the remote peer closes the media connection.<span class='warn'>Firefox does not yet support this event.</span>"
           },
           {
             "name": "'error'",

文件差異過大導致無法顯示
+ 21 - 8
docs/index.html


+ 1 - 1
docs/package.json

@@ -11,7 +11,7 @@
   "license": "BSD",
   "readmeFilename": "readme.md",
   "dependencies": {
-    "reference": "0.0.0",
+    "reference": ">0.0.0",
     "handlebars": "~1.0.12"
   }
 }

+ 16 - 3
docs/template.html

@@ -124,13 +124,22 @@ conn.send({
 
         <h3>Are there any caveats?</h3>
 
-          <p>A very low percentage of users are behind symmetric NATs. When two
+          <p>A small percentage of users are behind symmetric NATs. When two
           symmetric NAT users try to connect to each other, NAT traversal is
         impossible and no connection can be made. A workaround is to proxy
-      through what is known as a TURN server. The PeerServer cloud service does
+      through the connection through a TURN server. The PeerServer cloud service does
     not provide a TURN server. You'll have to find your own. You can pass a TURN
   server into the <code>Peer</code> object options. This will allow your PeerJS app to work seamlessly for this situation</p>
-
+        <h3>How do I use a TURN server?</h3>
+        <p>When creating your Peer object, pass in the ICE servers as the config key of the options hash.</p>
+<pre>
+var peer = new Peer({
+  config: {'iceServers': [
+    { url: 'stun:stun.l.google.com:19302' },
+    { url: 'turn:homeo@turn.bistri.com:80', credential: 'homeo' }
+  ]} /* Sample servers, please use appropriate ones */
+});
+</pre>
         <h3>What is the current state of browser compatibility?</h3>
 
           <p>We keep an frequently-updated catalogue of WebRTC compatibility
@@ -142,6 +151,10 @@ conn.send({
           <p>When you try to connect to a peer, PeerServer will hold a
           connection offer for up to 5 seconds before rejecting it. This is useful if you want to reconnect to a peer as it disconnects and reconnects rapidly between web pages.</p>
 
+        <h3>Why am I unable to connect?</h3>
+          <p>You could be behind a symmetric NAT, in which case you'll need to set up a TURN server.</p>
+          <p>Another possible issue is your network blocking port 9000, which the PeerServer cloud runs on. In this you must use your own PeerServer running on an appropriate port instead of the cloud service.</p>
+
         <h3>What about latency/bandwidth?</h3>
 
           <p>Data sent between the two peers do not touch any other servers, so the connection speed is limited only by the upload and download rates of the two peers. This also means you don't have the additional latency of an intermediary server.</p>

部分文件因文件數量過多而無法顯示