Browse Source

relative url #12

Michelle Bu 12 năm trước cách đây
mục cha
commit
6c03c7b6f9
3 tập tin đã thay đổi với 12 bổ sung0 xóa
  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',

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 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',

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác