0.6.12 • Published 7 years ago

node-rnr v0.6.12

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

node-rnr

Record & Replay HTTP streams by node.js

Overview

rnr creates a proxy server between user client and remote server.It records responses from remote server in file system and replays them when user client request again.

        request   __________  request   ________
user       →     | has      |    →     | remote |
client     ←     | records? |    ←     | server |
        response |__________| response |________|
                      ↑ ↓
                  file system

Usage

Install it:

npm install node-rnr -g

Commands

rnr --target [remote server host]

Proxy:

# dumb proxy
rnr --target http://localhost:8888

Record & Replay:

# record client requests
rnr --record --target http://localhost:8888

# replay request with records
rnr --replay --target http://localhost:8888

See a list of all available options:

rnr --help

Config File

You can use config file instead of command line options:

// rnr.config.js
module.exports = {
  record: true,
  replay: false,
  port: 5000,
  proxy: {
    target: 'http://localhost:8888',
    changeOrigin: true,
  },
  verbose: true,
}

Run this command to use the config file:

rnr -c # default config file rnr.config.js
rnr -c my.rnr.config.js # customize config file

More

License

MIT © BinRui.Guan

0.6.12

7 years ago

0.6.11

7 years ago

0.6.10

7 years ago

0.6.9

7 years ago

0.6.8

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago