mafintosh / peer-wire-swarm

swarm implementation for bittorrent
MIT License
80 stars 18 forks source link

Bind to a certain address when localAddress option has been given #17

Open skerit opened 9 years ago

skerit commented 9 years ago

For my use-case I wanted to download torrents over a specific device (a TUN OpenVPN device, more precisely)

Because of the modular approach to torrent-stream I had to for fork the torrent-stream, bittorrent-dht, peer-wire-swarm and utp repositories and make modifications to each of them.

I haven't created any pull requests for those in case you're not interested.

I also have noticed in the code that utp connections are currently not made in torrent-stream, but maybe that was by design because when I did enable it performance wasn't that stellar, especially not over the vpn device.

I also have not yet made modifications to the bittorrent-tracker repository, right now the actual downloading of chunks over the vpn device is more important than detecting peers.

As you can see: the localAddress option can be a string (an ip address) or a function. I went for this because the ip address of a vpn connection is prone to change.

Miserlou commented 8 years ago

@skerit - Was wondering if you'd be interested in releasing your changes to those other packages as well, as well as taking a look at #20 ?