0.1.3 • Published 5 years ago

webapirecorder v0.1.3

Weekly downloads
3
License
BSD-2-Clause
Repository
github
Last release
5 years ago

WebAPI Recorder

The WebAPI Recorder is a small MITM proxy for supporting web frontend development. It can record, cache and manipulate the content of HTTP and WS connections which allows easy testing of new features even if the backend is still in development.

Demo example

The demo example start the app

const app = require('./lib/app');
app.main("./demo_config.json");

using the config file "demo_config.json":

{
  "cache": true,
  "default_host": "gmx.de",
  "logging": {
    "files": [
      {
        "name": "app_error.log",
        "level": "error"
      },
      {
        "name": "app.log",
        "level": "debug"
      }
    ],
    "console_level": "debug"
  },
  "server_ports": [8085, 8086, 8087],
  "routes": [
    {
      "source": 8085,
      "target": {
        "port": 80,
        "protocol": "HTTP"
      }
    },
    {
      "source": 8086,
      "target": {
        "host": "web.de",
        "protocol": "HTTP"
      }
    },
    {
      "source": 8087,
      "target": {
        "host": "echo.websocket.org",
        "protocol": "WS",
        "secure": true,
        "direction": "BIDI"
      }
    }
  ],
  "upstreams": [
    {
      "host": "echo.websocket.org",
      "protocol": "WS",
      "secure": true
    }
  ]
}

This config describes the proxy setup.

Config

Extension Points

Actions

Mirror

Cache

Receipts

Inject messages

By action file

By action websocket

By JS

Regular messages

Filter messages