Skip to content

Commit 687f580

Browse files
committed
readme
1 parent bf5b9f2 commit 687f580

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,16 @@ var server = new Server({
112112
udp: true, // enable udp server? [default=true]
113113
http: true, // enable http server? [default=true]
114114
ws: true, // enable websocket server? [default=false]
115-
filter: function (infoHash, params) {
115+
filter: function (infoHash, params, cb) {
116116
// black/whitelist for disallowing/allowing torrents [default=allow all]
117117
// this example only allows this one torrent
118-
return infoHash === 'aaa67059ed6bd08362da625b3ae77f6f4a075aaa'
118+
cb(infoHash === 'aaa67059ed6bd08362da625b3ae77f6f4a075aaa')
119119

120-
// you can also block by peer id (whitelisting torrent clients) or by
121-
// secret key, as you get full access to the original http GET
120+
// it's possible to interface with a database or external system before
121+
// deciding, because this function is async
122+
123+
// it's possible to block by peer id (whitelisting torrent clients) or
124+
// by secret key, as you get full access to the original http/udp
122125
// request parameters in `params`
123126
})
124127
})

0 commit comments

Comments
 (0)