mirror of
https://github.com/logos-storage/bittorrent-tracker.git
synced 2026-05-21 07:49:55 +00:00
few es6 sugar
This commit is contained in:
parent
502b11fb9e
commit
7df1bdfa3f
@ -1,4 +1,4 @@
|
|||||||
const Buffer = require('safe-buffer').Buffer
|
const { Buffer } = require('safe-buffer')
|
||||||
const bencode = require('bencode')
|
const bencode = require('bencode')
|
||||||
const debug = require('debug')('bittorrent-tracker:server')
|
const debug = require('debug')('bittorrent-tracker:server')
|
||||||
const dgram = require('dgram')
|
const dgram = require('dgram')
|
||||||
@ -272,8 +272,7 @@ class Server extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onError (err) {
|
_onError (err) {
|
||||||
const self = this
|
this.emit('error', err)
|
||||||
self.emit('error', err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
listen (...args) /* port, hostname, onlistening */{
|
listen (...args) /* port, hostname, onlistening */{
|
||||||
@ -426,8 +425,7 @@ class Server extends EventEmitter {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onWebSocketConnection (socket, opts) {
|
onWebSocketConnection (socket, opts = {}) {
|
||||||
if (!opts) opts = {}
|
|
||||||
opts.trustProxy = opts.trustProxy || this._trustProxy
|
opts.trustProxy = opts.trustProxy || this._trustProxy
|
||||||
|
|
||||||
socket.peerId = null // as hex
|
socket.peerId = null // as hex
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user