https://github.com/arb/good-http
Http(s) broadcasting for Good process monitor
https://github.com/arb/good-http
Last synced: 8 months ago
JSON representation
Http(s) broadcasting for Good process monitor
- Host: GitHub
- URL: https://github.com/arb/good-http
- Owner: arb
- License: other
- Created: 2014-10-06T19:30:32.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-03-17T15:42:13.000Z (about 10 years ago)
- Last Synced: 2025-08-11T00:27:07.066Z (10 months ago)
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# good-http
Http(s) broadcasting for Good process monitor
[](https://travis-ci.org/hapijs/good-file) 
Lead Maintainer: [Adam Bretz](https://github.com/arb)
## Usage
`good-http` is a [good-reporter](https://github.com/hapijs/good-reporter) implementation to write [hapi](http://hapijs.com/) server events to remote endpoints. It makes a "POST" request with a JSON payload to the supplied `endpoint`.
## Good Http
### new GoodHttp (endpoint, [options])
creates a new GoodFile object with the following arguments
- `endpoint` - full path to remote server to transmit logs.
- `[options]` - optional arguments object
- `[events]` - an object of key value paris. Defaults to `{ request: '*', log: '*' }`.
- `key` - one of ("request", "log", "error", or "ops") indicating the hapi event to subscribe to
- `value` - an array of tags to filter incoming events. An empty array indicates no filtering.
- `threshold` - number of events to hold before transmission. Defaults to `20`. Set to `0` to have every event start transmission instantly. It is strongly suggested to have a set threshold to make data transmission more efficient.
- `[wreck]` - configuration object to pass into [`wreck`](https://github.com/hapijs/wreck#advanced). Defaults to `{ timeout: 60000, headers: {} }`. `content-type` is always "application/json".
### GoodHttp Methods
`good-file` implements the [good-reporter](https://github.com/hapijs/good-reporter) interface as has no additional public methods.
- `stop(callback)` - `GoodHttp` will make a final attempt to transmit anything remaining in it's internal event queue when `stop` is called.