Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for NAT traversal techniques #1437

Open
wants to merge 20 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

change callback to arrow function

  • Loading branch information
oleiba committed Sep 6, 2018
commit d872923b84e8fa15f732e94884f77cd44209e78c
@@ -117,15 +117,15 @@ class WebTorrent extends EventEmitter {
this._destroy(err)
})

this.dht.once('listening', function () {
var address = this.dht.address()
if (address) {
this.dhtPort = address.port
if (self._natTraversal.portMapping) {
this._natTraversal.portMapping(this.dhtPort, 'udp')
this.dht.once('listening', () => {
const address = this.dht.address()
if (address) {
this.dhtPort = address.port
if (this._natTraversal.portMapping) {
this._natTraversal.portMapping(this.dhtPort, 'udp')
}
}
}
})
})

// Ignore warning when there are > 10 torrents in the client
this.dht.setMaxListeners(0)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.