/http-receiver

An http endpoint receiving and showing requests in realtime

Primary LanguageJavaScript

http-receiver

An http endpoint that provides realtime views.

record

Get Started

Copy the following code into your page:

<script>
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
</script>

Checkout http://log.harttle.com for your log.

Host Yourself

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

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

Send log to http://localhost:3000 and checkout http://localhost:8080 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