- Source
Classes
Methods
(inner) Open(protocol, address) → {NetConn}
Open opens a new connection to the address with a timeout. Supported protocols: tcp, udp.
Parameters:
Name | Type | Description |
---|---|---|
protocol | string | The protocol to use. |
address | string | The address to connect to. |
- Source
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:
Name | Type | Description |
---|---|---|
protocol | string | The protocol to use. |
address | string | The address to connect to. |
- Source
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');