An open API service indexing awesome lists of open source software.

https://github.com/harttle/http-receiver

An http endpoint receiving and showing requests in realtime
https://github.com/harttle/http-receiver

http log realtime

Last synced: 10 months ago
JSON representation

An http endpoint receiving and showing requests in realtime

Awesome Lists containing this project

README

          

# http-receiver

An http endpoint that provides realtime views.

![record](https://user-images.githubusercontent.com/4427974/38619045-dd4027de-3dcd-11e8-99d7-8ae740be0fec.gif)

## Get Started

Copy the following code into your page:

```html

window.rlog = window.remoteLog = function () {
var text = Array.prototype.slice.call(arguments).map(function (arg) {
return typeof arg === 'object' ? JSON.stringify(arg) : arg;
}).join(' ');
var img = document.createElement('img');
img.src = 'receiver.harttle.com/?text=' + encodeURIComponent(text);
};
rlog('foo', '我爱你中国', {foo: 'bar'}); // send anything using rlog

```

Checkout for your log.

## Host Yourself

The receiver is a Node.js-based server and available on npm:

```bash
npm i -g http-receiver
PORT=8080 http-receiver
```

Send log to and checkout for your log.

## Environments

* `REC_PORT`: the port to receive data, default 3000
* `WEB_PORT`: the port showing realtime logs, default 8080
* `SIZE`: queue size for the cached requests, default 10