Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2017-01-20 02:28:58 +0300
committerGitHub <noreply@github.com>2017-01-20 02:28:58 +0300
commit0bda84ff6c7a2ab5a5517ed515ca8aef2983bb86 (patch)
treeeef68bf4360ae44041d7b0ed445379a674b5ed0c /lib
parentbeda5162c573adbecf5d6777b6821ec451b46639 (diff)
parent5d7fe98c6c1134bc057c27a57333dfd1a3964e6a (diff)
Merge pull request #1019 from feross/fix-962
Set user-agent header for http tracker requests
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index ad0785d..21b19af 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -52,6 +52,7 @@ var FILESYSTEM_CONCURRENCY = 2
var RECONNECT_WAIT = [ 1000, 5000, 15000 ]
var VERSION = require('../package.json').version
+var USER_AGENT = 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'
var TMP
try {
@@ -332,7 +333,8 @@ Torrent.prototype._onListening = function () {
peerId: self.client.peerId,
dht: !self.private && self.client.dht,
tracker: trackerOpts,
- port: self.client.torrentPort
+ port: self.client.torrentPort,
+ userAgent: USER_AGENT
})
self.discovery.on('error', onError)
@@ -395,7 +397,7 @@ Torrent.prototype._getMetadataFromServer = function () {
url: url,
method: 'GET',
headers: {
- 'user-agent': 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'
+ 'user-agent': USER_AGENT
}
}
var req