Develop with
transparency

  • Receive JSON blobs as a local HTTP server
  • POST to blobster during development
  • View JSON with a human readable interface
  • Debug transient data on the fly

Download

F.A.Q.

Why?

Not every development environment has an easy way to log data, variables, parameters, etc. Even those that do may still make it difficult to actually comprehend large JSON blobs as a human being. Blobster is a simple window into any development process that can encode JSON and make HTTP requests.

How?

Viewing a JSON blob in Blobster is simply a matter of opening the application and sending a POST to localhost:8108/blob. The API is quite simple.

How do I view blobs from a remote server?

Do you have SSH access? Not everyone is aware that SSH port forwarding can operate in both directions. Making the Blobster HTTP server available on the remote box may be as simple as ssh -fNT -R 8108:localhost:8108 devbox with OpenSSH.

How do I send blobs from within a docker container?

Making Blobster's server available from within the docker network isn't as easy. Alternatively, use blobster-relay to extract blobs out of the docker network. Blobster will automatically establish a websocket connection with the relay on port 8109.

Clients

Here are some dependency free clients to include in your project to get you started.

Browser

function log(label, blob){
  var xhr = new XMLHttpRequest();
  xhr.open('POST', 'http://localhost:8108/blob');
  xhr.setRequestHeader('Content-Type', 'application/json')
  xhr.send(JSON.stringify({label: label, blob: blob}));
}

Node

const http = require('http');

const log = (label, blob) => {
  const req = http.request({
    host: 'localhost',
    path: '/blob',
    port: 8108,
    method: 'POST',
    headers: {'Content-Type': 'application/json'}
  })
  req.write(JSON.stringify({label, blob}));
  req.end();
}

Python

from urllib.request import urlopen, Request
import json

def log(label: str, blob: dict) -> None:
  body = {
    'label': label, 
    'blob': blob
  }
  data = json.dumps(body).encode('utf-8')
  headers = {'Content-Type': 'application/json'}
  urlopen(Request('http://localhost:8108/blob', data=data, headers=headers))

PHP

<?php 

class Blobster {
  public static function log($label, $blob) {
    $url = 'http://localhost:8108/blob';
    $body = json_encode([
      'label' => $label,
      'blob' => json_decode(json_encode($blob))
    ]);
    $options = [
      'http' => [
        'header' => 'Content-Type: application/json',
        'method' => 'POST',
        'content' => $body
      ]
    ];
    $context = stream_context_create($options);
    file_get_contents($url, false, $context);
  }
}