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/docs
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 /docs
parentd2d8c860dd265cb9431ddbb3426f671538c6483d (diff)
doc: torrent.createServer() takes a function argument
Diffstat (limited to 'docs')
-rw-r--r--docs/api.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/api.md b/docs/api.md
index 3ecb957..453e374 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -314,12 +314,13 @@ Deprioritizes a range of previously selected pieces.
Marks a range of pieces as critical priority to be downloaded ASAP. From `start` to `end`
(both inclusive).
-## `torrent.createServer([opts])`
+## `torrent.createServer([requestListener])`
Create an http server to serve the contents of this torrent, dynamically fetching the
needed torrent pieces to satisfy http requests. Range requests are supported.
-Returns an `http.Server` instance (got from calling `http.createServer`). If `opts` is specified, it is passed to the `http.createServer` function.
+Returns an `http.Server` instance (got from calling `http.createServer`). If
+`requestListener` is specified, it is added to the 'request' event.
Visiting the root of the server `/` will show a list of links to individual files. Access
individual files at `/<index>` where `<index>` is the index in the `torrent.files` array