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 'user-agent' option #961

Closed
wants to merge 3 commits into from
Closed
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

Prev

add 'use-agent' option

  • Loading branch information
zunsthy committed Nov 6, 2016
commit 8b1bb129f7fb16560c03b9b2c8bbea9fffa00649
@@ -78,6 +78,12 @@ function WebTorrent (opts) {
}
self.nodeIdBuffer = Buffer.from(self.nodeId, 'hex')

if (typeof opts.userAgent === 'string') {
self.userAgent = opts.userAgent
} else {
self.userAgent = 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'
}

self.destroyed = false
self.listening = false
self.torrentPort = opts.torrentPort || 0
@@ -330,6 +330,7 @@ Torrent.prototype._onListening = function () {
infoHash: self.infoHash,
announce: self.announce,
peerId: self.client.peerId,
userAgent: self.client.userAgent,
dht: !self.private && self.client.dht,
tracker: trackerOpts,
port: self.client.torrentPort
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.