mirror of
https://github.com/webtorrent/bittorrent-tracker.git
synced 2025-01-18 12:11:36 +00:00
style: use object shorthand for properties (#400)
This commit is contained in:
parent
892b848911
commit
8222ccd1d6
@ -125,7 +125,7 @@ class HTTPTracker extends Tracker {
|
||||
|
||||
let request = get.concat({
|
||||
url: parsedUrl.toString(),
|
||||
agent: agent,
|
||||
agent,
|
||||
timeout: common.REQUEST_TIMEOUT,
|
||||
headers: {
|
||||
'user-agent': this.client._userAgent || ''
|
||||
|
@ -258,7 +258,7 @@ class UDPTracker extends Tracker {
|
||||
|
||||
function send (message, proxyInfo) {
|
||||
if (proxyInfo) {
|
||||
const pack = Socks.createUDPFrame({ host: hostname, port: port }, message)
|
||||
const pack = Socks.createUDPFrame({ host: hostname, port }, message)
|
||||
socket.send(pack, 0, pack.length, proxyInfo.port, proxyInfo.host)
|
||||
} else {
|
||||
socket.send(message, 0, message.length, port, hostname)
|
||||
|
@ -186,7 +186,7 @@ class WebSocketTracker extends Tracker {
|
||||
agent = new Socks.Agent(clone(this.client._proxyOpts.socksProxy), (parsedUrl.protocol === 'wss:'))
|
||||
}
|
||||
}
|
||||
this.socket = socketPool[this.announceUrl] = new Socket({ url: this.announceUrl, agent: agent })
|
||||
this.socket = socketPool[this.announceUrl] = new Socket({ url: this.announceUrl, agent })
|
||||
this.socket.consumers = 1
|
||||
this.socket.once('connect', this._onSocketConnectBound)
|
||||
}
|
||||
|
@ -582,7 +582,7 @@ function testClientStartHttpAgent (t, serverType) {
|
||||
infoHash: fixtures.leaves.parsedTorrent.infoHash,
|
||||
announce: announceUrl,
|
||||
peerId: peerId1,
|
||||
port: port,
|
||||
port,
|
||||
wrtc: {},
|
||||
proxyOpts: {
|
||||
httpAgent: agent
|
||||
|
Loading…
Reference in New Issue
Block a user