浏览代码

relative url #12

Michelle Bu 12 年之前
父节点
当前提交
6c03c7b6f9
共有 3 个文件被更改,包括 12 次插入0 次删除
  1. 6 0
      dist/peer.js
  2. 0 0
      dist/peer.min.js
  3. 6 0
      lib/peer.js

+ 6 - 0
dist/peer.js

@@ -1144,6 +1144,12 @@ function Peer(id, options) {
   if (!(this instanceof Peer)) return new Peer(id, options);
   EventEmitter.call(this);
 
+  // Detect relative URL host.
+  if (options.host === '/') {
+    options.host = window.location.hostname;
+    console.log('wat')
+  }
+
   options = util.extend({
     debug: false,
     host: '0.peerjs.com',

文件差异内容过多而无法显示
+ 0 - 0
dist/peer.min.js


+ 6 - 0
lib/peer.js

@@ -9,6 +9,12 @@ function Peer(id, options) {
   if (!(this instanceof Peer)) return new Peer(id, options);
   EventEmitter.call(this);
 
+  // Detect relative URL host.
+  if (options.host === '/') {
+    options.host = window.location.hostname;
+    console.log('wat')
+  }
+
   options = util.extend({
     debug: false,
     host: '0.peerjs.com',

部分文件因为文件数量过多而无法显示