mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 20:21:36 +00:00
emit port with 'listening' event
This commit is contained in:
parent
ba6d85c0a9
commit
d35807f5a3
@ -106,8 +106,8 @@ server.on('warning', function (err) {
|
||||
console.log(err.message)
|
||||
})
|
||||
|
||||
server.on('listening', function () {
|
||||
console.log('tracker server is listening!')
|
||||
server.on('listening', function (port) {
|
||||
console.log('tracker server is now listening on ' + port)
|
||||
})
|
||||
|
||||
// start tracker server listening!
|
||||
@ -137,6 +137,8 @@ server.torrents[infoHash].incomplete
|
||||
server.torrents[infoHash].peers
|
||||
```
|
||||
|
||||
The http server will handle requests for the following paths: `/announce`, `/scrape`. Requests for other paths will not be handled.
|
||||
|
||||
## license
|
||||
|
||||
MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).
|
||||
|
@ -12,7 +12,6 @@ var parallel = require('run-parallel')
|
||||
var querystring = require('querystring')
|
||||
var string2compact = require('string2compact')
|
||||
|
||||
|
||||
var REMOVE_IPV6_RE = /^::ffff:/
|
||||
|
||||
inherits(Server, EventEmitter)
|
||||
@ -78,7 +77,7 @@ Server.prototype.listen = function (port, onlistening) {
|
||||
|
||||
parallel(tasks, function (err) {
|
||||
if (err) return self.emit('error', err)
|
||||
self.emit('listening')
|
||||
self.emit('listening', port)
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user