File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff 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})
You can’t perform that action at this time.
0 commit comments