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-03-17 02:20:43 +0300
committerFeross Aboukhadijeh <feross@feross.org>2017-03-17 02:20:43 +0300
commitacf3580e44ac32abe46347357ab4a261005bb14b (patch)
treecb011e61296b2c83ee4c8e1c8fb2bb299594cffc /lib
parentd2d8c860dd265cb9431ddbb3426f671538c6483d (diff)
doc: torrent.createServer() takes a function argument
Diffstat (limited to 'lib')
-rw-r--r--lib/server.js4
-rw-r--r--lib/torrent.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/server.js b/lib/server.js
index af46b85..ea4f319 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -7,8 +7,8 @@ var pump = require('pump')
var rangeParser = require('range-parser')
var url = require('url')
-function Server (torrent, opts) {
- var server = http.createServer(opts)
+function Server (torrent, requestListener) {
+ var server = http.createServer(requestListener)
var sockets = []
var pendingReady = []
diff --git a/lib/torrent.js b/lib/torrent.js
index 9617b18..661c30c 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -1623,10 +1623,10 @@ Torrent.prototype.load = function (streams, cb) {
})
}
-Torrent.prototype.createServer = function (opts) {
+Torrent.prototype.createServer = function (requestListener) {
if (typeof Server !== 'function') throw new Error('node.js-only method')
if (this.destroyed) throw new Error('torrent is destroyed')
- var server = new Server(this, opts)
+ var server = new Server(this, requestListener)
this._servers.push(server)
return server
}