Skip to content

Commit b3e96e1

Browse files
committed
port-scanner: updated docs
1 parent 6bbf353 commit b3e96e1

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

packages/port-scanner/NOTES.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/port-scanner/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,22 @@ port scanner utility
1414

1515
### Usage
1616

17+
*`connectionOpts` is a direct pass in to
18+
[`net.createConnection(<opts>)`](https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener)
19+
1720
```
1821
import PortScanner from '@mi-sec/port-scanner';
1922
2023
const scan = new PortScanner( {
2124
host: '192.168.1.0/24',
2225
ports: [ 22 ],
23-
timeout: 100,
24-
attemptToIdentify: true
26+
timeout: 1000, // optional
27+
debug: false, // optional
28+
onlyReportOpen: true, // optional
29+
bannerGrab: true, // optional
30+
identifyService: true, // optional
31+
attemptToIdentify: true, // optional
32+
connectionOpts: {} // optional*
2533
} );
2634
2735
const data = [];

packages/port-scanner/lib/port-scanner.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class PortScanner extends EventEmitter
258258
Array.isArray( this.opts.ports ) ? this.opts.ports : [ this.opts.ports ] :
259259
[ ...commonPorts.keys() ];
260260

261-
this.opts.timeout = this.opts.timeout || 500;
261+
this.opts.timeout = this.opts.timeout || 1000;
262262

263263
this.opts.debug = this.opts.hasOwnProperty( 'debug' ) ? this.opts.debug : false;
264264
this.opts.onlyReportOpen = this.opts.hasOwnProperty( 'onlyReportOpen' ) ? this.opts.onlyReportOpen : true;
@@ -273,7 +273,7 @@ class PortScanner extends EventEmitter
273273
!this.opts.debug || console.log( ` debug: ${ this.opts.debug }` );
274274
!this.opts.debug || console.log( ` onlyReportOpen: ${ this.opts.onlyReportOpen }` );
275275
!this.opts.debug || console.log( ` bannerGrab: ${ this.opts.bannerGrab }` );
276-
!this.opts.debug || console.log( ` attemptToIdentify: ${ this.opts.attemptToIdentify }` );
276+
!this.opts.debug || console.log( ` identifyService: ${ this.opts.identifyService }` );
277277

278278
this.result = new LightMap();
279279

0 commit comments

Comments
 (0)