Classes

NetConn

Methods

(inner) Open(protocol, address) → {NetConn}

Open opens a new connection to the address with a timeout. Supported protocols: tcp, udp.
Parameters:
NameTypeDescription
protocolstringThe protocol to use.
addressstringThe address to connect to.
Throws:
- The error encountered during connection opening.
Type
error
Returns:
- The NetConn object representing the connection.
Type: 
NetConn
Example
let m = require('nuclei/net'); 
let conn = m.Open('tcp', 'localhost:8080');

(inner) OpenTLS(protocol, address) → {NetConn}

OpenTLS opens a new connection to the address with a timeout. Supported protocols: tcp, udp.
Parameters:
NameTypeDescription
protocolstringThe protocol to use.
addressstringThe address to connect to.
Throws:
- The error encountered during connection opening.
Type
error
Returns:
- The NetConn object representing the connection.
Type: 
NetConn
Example
let m = require('nuclei/net'); 
let conn = m.OpenTLS('tcp', 'localhost:8080');