ericz 12 năm trước cách đây
mục cha
commit
ef46081949
2 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 1 1
      lib/connection.js
  2. 1 1
      lib/peer.js

+ 1 - 1
lib/connection.js

@@ -250,7 +250,7 @@ DataConnection.prototype._makeOffer = function() {
         sdp: offer,
         dst: self._peer,
         src: self._id,
-        metadata: self._metadata
+        metadata: self.metadata
       }));
     }, function(err) {
       self._cb('Failed to setLocalDescription');

+ 1 - 1
lib/peer.js

@@ -40,7 +40,7 @@ Peer.prototype._socketInit = function() {
         };
         var connection = new DataConnection(self._id, peer, self._socket, function(err, connection) {
           if (!err) {
-            self.emit('connection', connection);
+            self.emit('connection', connection, metadata);
           }
         }, options);
         self.connections[peer] = connection;