# good-http

> Http(s) broadcasting for Good process monitor

Latest version **6.1.3** (published 2017-04-13) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install good-http
pnpm add good-http
yarn add good-http
bun add good-http
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 6.1.3 |
| Published | 2017-04-13 |
| First published | 2014-09-19 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | arb, lloydbenson |

## Links

- npm: https://www.npmjs.com/package/good-http
- Repository: https://github.com/hapijs/good-http
- Homepage: https://github.com/hapijs/good-http#readme
- Issues: https://github.com/hapijs/good-http/issues
- npm.io page: https://npm.io/package/good-http

## Dependencies (2)

- [wreck](https://npm.io/package/wreck.md) 10.x.x
- [fast-safe-stringify](https://npm.io/package/fast-safe-stringify.md) 1.1.x

## Recent versions

- 6.1.3 (latest) — 2017-04-13
- 6.1.2 — 2017-01-10
- 6.1.1 — 2016-10-03
- 6.1.0 — 2016-08-15
- 6.0.2 — 2016-05-27
- 6.0.1 — 2016-05-02
- 5.1.1 — 2016-04-21
- 6.0.0 — 2016-03-18
- 5.1.0 — 2015-07-07
- 5.0.0 — 2015-04-07
- 4.0.0 — 2014-12-10
- 3.0.2 — 2014-12-04
- 3.0.1 — 2014-11-10
- 3.0.0 — 2014-11-04
- 2.0.0 — 2014-10-07
- … 2 more at https://npm.io/package/good-http/versions

## README

# good-http

Http(s) broadcasting for Good process monitor

[![Build Status](https://travis-ci.org/hapijs/good-http.svg?branch=master)](https://travis-ci.org/hapijs/good-http)
[![Current Version](https://img.shields.io/npm/v/good-http.svg)](https://www.npmjs.com/package/good-http)

Lead Maintainer: [Adam Bretz](https://github.com/arb)

## Usage

`good-http` is a write stream use to send event to remote endpoints in batches. It makes a "POST" request with a JSON payload to the supplied `endpoint`. It will make a final "POST" request to the endpoint to flush the rest of the data on "finish".

## Good Http
### GoodHttp (endpoint, config)

Creates a new GoodHttp object where:

- `endpoint` - full path to remote server to transmit logs.
- `config` - configuration object
  - `[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.
  - `[errorThreshold]` - number of consecutive failed transmissions allowed (`ECONNRESET`, `ECONNREFUSED`, etc). Defaults to `0`. Failed events will be included in the next transmission until they are successfully logged or the threshold is reached (whichever comes first) at which point they will be cleared. Set to `null` to ignore all errors and always clear events.
  - `[wreck]` - configuration object to pass into [`wreck`](https://github.com/hapijs/wreck#advanced). Defaults to `{ timeout: 60000, headers: {} }`. `content-type` is always "application/json".


### Schema

Each POST will match the following schema. The payload that is POSTed to the `endpoint` has the following schema:

```json
{
  "host":"servername.home",
  "schema":"good-http",
  "timeStamp":1412710565121,
  "events":[
      {
        "event":"request",
        "timestamp":1413464014739,
        ...
      },
      {
        "event":"request",
        "timestamp":1414221317758,
        ...
      },
      {
        "event":"request",
        "timestamp":1415088216608,
        ...
      }
      {
        "event":"log",
        "timestamp":1415180913160,
        ...
      },
      {
        "event":"log",
        "timestamp":1422493874390,
        ...
      }
  ]
}
```

---
_Source: https://npm.io/package/good-http · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
