good-tcp
v1.1.0
Published
A TCP and TLS transport stream for Hapi's Good server and process monitor
Downloads
19
Maintainers
Readme
good-tcp
TCP broadcasting for the Good process monitor with optional TLS support.
Development on good-tcp is sponsored by Sparo Labs.
Install
$ npm install --save good-tcp
Usage
new GoodTcp(endpoint, [config])
Creates a new GoodTcp
object where:
endpoint
- A full path to a remote server to transmit logs.config
- Configuration object:threshold
- The number of events to hold before transmission. Defaults to20
. Set to0
to have every event start transmission immediately. It is recommended to setthreshold
as high as possible to make data transmission more efficient and reduce the number of TCP connections that must be initiated.maxDelay
- Maximum milliseconds to allow buffer to wait before forcing a stream write on next message. Defaults to0
, turning off this feature. If you have a server that generates logs infrequently, turn on this feature to see logs arriving in batches, but more regularly.tls
- Whether to transmit via TLS. Defaults tofalse
.tlsOptions
- Options to configure the TLS connection. Please see the Node.js documentation for TLS for the available options and their defaults.
When stream
emits an "end" event, GoodTcp
will transmit any events remaining in it's internal buffer to attempt to prevent data loss.
Version Compatibility
This plugin extends Stream.Writable
and is compatible with Good version 7.0 and higher.
Note: This plugin does not implement the interface expected by earlier versions of Good
.
License
This project is licensed under the MIT license. See the LICENSE file for more info.