Skip to content

Commit f94075f

Browse files
committed
expose common config params to allow changing them
1 parent 0b6d72c commit f94075f

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*! bittorrent-tracker. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
22
import Client from './client.js'
33
import Server from './server.js'
4+
import common from './lib/common.js'
45

56
export default Client
6-
export { Client, Server }
7+
export { Client, Server, common }

lib/common-node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ export const EVENT_NAMES = {
3232
* Client request timeout. How long to wait before considering a request to a
3333
* tracker server to have timed out.
3434
*/
35-
export const REQUEST_TIMEOUT = 15000
35+
export let REQUEST_TIMEOUT = 15000
3636

3737
/**
3838
* Client destroy timeout. How long to wait before forcibly cleaning up all
3939
* pending requests, open sockets, etc.
4040
*/
41-
export const DESTROY_TIMEOUT = 1000
41+
export let DESTROY_TIMEOUT = 1000
4242

4343
export function toUInt32 (n) {
4444
const buf = new Uint8Array(4)

lib/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import * as common from './common-node.js'
55
export * from './common-node.js'
66

7-
export const DEFAULT_ANNOUNCE_PEERS = 50
8-
export const MAX_ANNOUNCE_PEERS = 82
7+
export let DEFAULT_ANNOUNCE_PEERS = 50
8+
export let MAX_ANNOUNCE_PEERS = 82
99

1010
// HACK: Fix for WHATWG URL object not parsing non-standard URL schemes like
1111
// 'udp:'. Just replace it with 'http:' since we only need a few properties.

0 commit comments

Comments
 (0)