bittorrent-relay
Advanced tools
Comparing version 4.0.1 to 4.0.2
47
index.js
@@ -544,30 +544,31 @@ import Debug from 'debug' | ||
socket.terminate() | ||
} | ||
self.trackers[socket.id] = socket | ||
socket.id = message.id | ||
socket.domain = message.domain | ||
socket.tracker = message.tracker | ||
socket.port = message.port | ||
socket.host = message.host | ||
socket.web = message.web | ||
socket.dht = message.dht | ||
socket.relay = message.web + '/relay' | ||
socket.announce = message.web + '/announce' | ||
for(const messageRelay of message.relays){ | ||
if(self.relays.includes(messageRelay)){ | ||
if(!socket.relays.includes(messageRelay)){ | ||
socket.relays.push(messageRelay) | ||
} else { | ||
self.trackers[socket.id] = socket | ||
socket.id = message.id | ||
socket.domain = message.domain | ||
socket.tracker = message.tracker | ||
socket.port = message.port | ||
socket.host = message.host | ||
socket.web = message.web | ||
socket.dht = message.dht | ||
socket.relay = message.web + '/relay' | ||
socket.announce = message.web + '/announce' | ||
for(const messageRelay of message.relays){ | ||
if(self.relays.includes(messageRelay)){ | ||
if(!socket.relays.includes(messageRelay)){ | ||
socket.relays.push(messageRelay) | ||
} | ||
} | ||
} | ||
} | ||
for(const messageHash of message.hashes){ | ||
if(self.hashes.includes(messageHash)){ | ||
if(!socket.hashes.includes(messageHash)){ | ||
socket.hashes.push(messageHash) | ||
for(const messageHash of message.hashes){ | ||
if(self.hashes.includes(messageHash)){ | ||
if(!socket.hashes.includes(messageHash)){ | ||
socket.hashes.push(messageHash) | ||
} | ||
} | ||
} | ||
if(socket.server){ | ||
socket.send(JSON.stringify({id: self.id, tracker: self.tracker, web: self.web, host: self.host, port: self.port, dht: self.dht, domain: self.domain, relays: self.relays, hashes: self.hashes, action: 'session'})) | ||
} | ||
} | ||
if(socket.server){ | ||
socket.send(JSON.stringify({id: self.id, tracker: self.tracker, web: self.web, host: self.host, port: self.port, dht: self.dht, domain: self.domain, relays: self.relays, hashes: self.hashes, action: 'session'})) | ||
} | ||
} | ||
@@ -574,0 +575,0 @@ if(message.action === 'web'){ |
{ | ||
"name": "bittorrent-relay", | ||
"description": "Uses the mainline dht to relay requests to other trackers in a swarm", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"bin": { | ||
@@ -6,0 +6,0 @@ "bittorrent-relay": "./bin/cmd.js" |
47718
1255