telnet-client
Advanced tools
Comparing version 1.1.2 to 1.2.0
import { EventEmitter } from 'events'; | ||
import { Stream } from 'stream'; | ||
import { Socket } from 'net'; | ||
import { Socket, SocketConnectOpts } from 'net'; | ||
@@ -9,2 +9,3 @@ declare interface ConnectOptions { | ||
localAddress?: string; | ||
socketConnectOptions?: SocketConnectOpts; | ||
timeout?: number; | ||
@@ -11,0 +12,0 @@ shellPrompt?: string; |
@@ -23,2 +23,3 @@ 'use strict' | ||
const localAddress = (typeof opts.localAddress !== 'undefined' ? opts.localAddress : '') | ||
const socketConnectOptions = (typeof opts.socketConnectOptions !== 'undefined' ? opts.socketConnectOptions : {}) | ||
this.timeout = (typeof opts.timeout !== 'undefined' ? opts.timeout : 500) | ||
@@ -65,3 +66,4 @@ | ||
host, | ||
localAddress | ||
localAddress, | ||
...socketConnectOptions | ||
}, () => { | ||
@@ -68,0 +70,0 @@ this.state = 'start' |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"main": "./lib/index.js", | ||
@@ -11,0 +11,0 @@ "types": "./lib/index.d.ts", |
@@ -211,2 +211,3 @@ [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/mkozjak/node-telnet-client/blob/master/LICENSE) | ||
* `localAddress`: Local interface to bind for network connections. Defaults to an empty string. More information can be found [here](https://nodejs.org/api/net.html#net_socket_localaddress). | ||
* `socketConnectOptions`: Allows to pass an object, which can contain every property from Node's SocketConnectOpts. Defaults to an empty object. Properties defined inside this object will overwrite any of the three above properties. More information can be found [here](https://nodejs.org/dist/latest-v12.x/docs/api/net.html#net_socket_connect_options_connectlistener). | ||
* `timeout`: Sets the socket to timeout after the specified number of milliseconds. | ||
@@ -213,0 +214,0 @@ of inactivity on the socket. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49926
1083
338