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.
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.