Interface IAnnounceRequestContext

Request announce

interface IAnnounceRequestContext {
    action: ANNOUNCE;
    addres: string;
    compact: number;
    downloaded: bigint;
    event: AnnounceEvent;
    infoHash: string;
    ip: string;
    isAnnounce: boolean;
    isCompact: boolean;
    isConnect: boolean;
    isScrape: boolean;
    isSourceHTTP: boolean;
    isSourceUDP: boolean;
    key?: string | number;
    left: bigint;
    noPeerId: number;
    numwant: number;
    peerId: string;
    port: number;
    requestPath?: string;
    sent: boolean;
    trackerId?: string | number;
    transactionId: number;
    uploaded: bigint;
    send(payload): Promise<void>;
}

Hierarchy (view full)

Implemented by

Properties

action: ANNOUNCE

Current action

addres: string

Returns the addres like ip:port

compact: number

Returns the indicates that the client accepts a compact response

downloaded: bigint

Returns the total amount downloaded (since the client sent the 'started' event to the tracker)

Returns be one of started, completed, stopped or update (if empty) started: The first request to the tracker must include the event key with this value stopped: Must be sent to the tracker if the client is shutting down gracefully completed: Must be sent to the tracker when the download completes update: This request is one performed at regular intervals.

infoHash: string

Returns 20-byte SHA1 hash of the value of the info key from the metainfo file

ip: string

Returns the true IP address of the client machine, in dotted quad format or rfc 3513 defined hexed IPv6 address.

isAnnounce: boolean

The current action is "announce"

isCompact: boolean

Checks that need a compact answer

isConnect: boolean

The current action is "connect"

isScrape: boolean

The current action is "scrape"

isSourceHTTP: boolean

The request source is HTTP

isSourceUDP: boolean

The request source is UDP

key?: string | number

Returns the an additional identification that is not shared with any other peers

left: bigint

Returns the number of bytes this client still has to download

noPeerId: number

Returns that the tracker can omit peer id field in peers dictionary

numwant: number

Returns the number of peers that the client would like to receive from the tracker

peerId: string

Returns 20-byte string used as a unique ID for the client, generated by the client at startup

port: number

Returns the port number that the client is listening on

requestPath?: string

Returns the request path

sent: boolean

Has an answer been sent

trackerId?: string | number

Returns the tracker id, if a previous announce contained

transactionId: number

Returns the transaction ID (only UDP)

uploaded: bigint

Returns the total amount uploaded (since the client sent the 'started' event to the tracker)

Methods