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
diff options
context:
space:
mode:
-rw-r--r--index.js4
-rw-r--r--lib/torrent.js4
-rw-r--r--lib/webconn.js4
3 files changed, 9 insertions, 3 deletions
diff --git a/index.js b/index.js
index 6e047a2..4ef2518 100644
--- a/index.js
+++ b/index.js
@@ -132,7 +132,9 @@ function WebTorrent (opts) {
if (typeof loadIPSet === 'function') {
loadIPSet(opts.blocklist, {
- headers: { 'user-agent': 'WebTorrent/' + VERSION + ' (http://webtorrent.io)' }
+ headers: {
+ 'user-agent': 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'
+ }
}, function (err, ipSet) {
if (err) return self.error('Failed to load blocklist: ' + err.message)
self.blocked = ipSet
diff --git a/lib/torrent.js b/lib/torrent.js
index 6b10927..db71a5f 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -51,6 +51,8 @@ var FILESYSTEM_CONCURRENCY = 2
var RECONNECT_WAIT = [ 1000, 5000, 15000 ]
+var VERSION = require('./package.json').version
+
var TMP
try {
TMP = path.join(fs.statSync('/tmp') && '/tmp', 'webtorrent')
@@ -393,7 +395,7 @@ Torrent.prototype._getMetadataFromServer = function () {
url: url,
method: 'GET',
headers: {
- 'user-agent': 'WebTorrent (https://webtorrent.io)'
+ 'user-agent': 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'
}
}
var req
diff --git a/lib/webconn.js b/lib/webconn.js
index a45ca68..3507241 100644
--- a/lib/webconn.js
+++ b/lib/webconn.js
@@ -7,6 +7,8 @@ var inherits = require('inherits')
var sha1 = require('simple-sha1')
var Wire = require('bittorrent-protocol')
+var VERSION = require('./package.json').version
+
inherits(WebConn, Wire)
/**
@@ -112,7 +114,7 @@ WebConn.prototype.httpRequest = function (pieceIndex, offset, length, cb) {
url: url,
method: 'GET',
headers: {
- 'user-agent': 'WebTorrent (http://webtorrent.io)',
+ 'user-agent': 'WebTorrent/' + VERSION + ' (https://webtorrent.io)'
'range': 'bytes=' + start + '-' + end
}
}