@@ -24,6 +24,7 @@ function WebSocketTracker (client, announceUrl, opts) {
2424
2525 self . client = client
2626
27+ self . _opts = opts
2728 self . _announceUrl = announceUrl
2829 self . _peers = { } // peers (offer id -> peer)
2930 self . _ready = false
@@ -124,15 +125,15 @@ WebSocketTracker.prototype._onSocketMessage = function (data) {
124125 peer = new Peer ( { trickle : false , config : self . _opts . rtcConfig } )
125126 peer . id = common . binaryToHex ( data . peer_id )
126127 peer . once ( 'signal' , function ( answer ) {
127- var opts = {
128+ var params = {
128129 info_hash : self . client . _infoHash . toString ( 'binary' ) ,
129130 peer_id : self . client . _peerId . toString ( 'binary' ) ,
130131 to_peer_id : data . peer_id ,
131132 answer : answer ,
132133 offer_id : data . offer_id
133134 }
134- if ( self . _trackerId ) opts . trackerid = self . _trackerId
135- self . _send ( opts )
135+ if ( self . _trackerId ) params . trackerid = self . _trackerId
136+ self . _send ( params )
136137 } )
137138 peer . signal ( data . offer )
138139 self . client . emit ( 'peer' , peer )
@@ -150,10 +151,10 @@ WebSocketTracker.prototype._onSocketMessage = function (data) {
150151 }
151152}
152153
153- WebSocketTracker . prototype . _send = function ( opts ) {
154+ WebSocketTracker . prototype . _send = function ( params ) {
154155 var self = this
155- debug ( 'send %s' , JSON . stringify ( opts ) )
156- self . _socket . send ( opts )
156+ debug ( 'send %s' , JSON . stringify ( params ) )
157+ self . _socket . send ( params )
157158}
158159
159160WebSocketTracker . prototype . _generateOffers = function ( numWant , cb ) {
0 commit comments