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({
|
let request = get.concat({
|
||||||
url: parsedUrl.toString(),
|
url: parsedUrl.toString(),
|
||||||
agent: agent,
|
agent,
|
||||||
timeout: common.REQUEST_TIMEOUT,
|
timeout: common.REQUEST_TIMEOUT,
|
||||||
headers: {
|
headers: {
|
||||||
'user-agent': this.client._userAgent || ''
|
'user-agent': this.client._userAgent || ''
|
||||||
|
@ -258,7 +258,7 @@ class UDPTracker extends Tracker {
|
|||||||
|
|
||||||
function send (message, proxyInfo) {
|
function send (message, proxyInfo) {
|
||||||
if (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)
|
socket.send(pack, 0, pack.length, proxyInfo.port, proxyInfo.host)
|
||||||
} else {
|
} else {
|
||||||
socket.send(message, 0, message.length, port, hostname)
|
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:'))
|
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.consumers = 1
|
||||||
this.socket.once('connect', this._onSocketConnectBound)
|
this.socket.once('connect', this._onSocketConnectBound)
|
||||||
}
|
}
|
||||||
|
@ -582,7 +582,7 @@ function testClientStartHttpAgent (t, serverType) {
|
|||||||
infoHash: fixtures.leaves.parsedTorrent.infoHash,
|
infoHash: fixtures.leaves.parsedTorrent.infoHash,
|
||||||
announce: announceUrl,
|
announce: announceUrl,
|
||||||
peerId: peerId1,
|
peerId: peerId1,
|
||||||
port: port,
|
port,
|
||||||
wrtc: {},
|
wrtc: {},
|
||||||
proxyOpts: {
|
proxyOpts: {
|
||||||
httpAgent: agent
|
httpAgent: agent
|
||||||
|
Loading…
Reference in New Issue
Block a user