🤖 Merge PR #46298 Bittorrent protocol add dynamic property key for extensions by @RonaldZielaznicki

* Add dynamic property to Wire Interface

* Attempt to access wire extensions name to test that extension can be accessed.
This commit is contained in:
RonaldZielaznicki 2020-07-28 14:29:05 -04:00 committed by GitHub
parent 18204efa01
commit 67d6207759
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -27,4 +27,7 @@ net.createServer(socket => {
// Extend wire using the test extension
wire.extended('extname', {});
// Confirm extension has been added to Wire instance.
console.log(wire.extname.name);
}).listen(6881);

View File

@ -56,6 +56,8 @@ declare namespace BittorrentProtocol {
use(ext: ExtensionConstructor): void;
[key: string]: any;
handshake(infoHash: string | Buffer, peerId: string | Buffer, extensions?: any): void;
choke(): void;