Git Product home page Git Product logo

node-rnr's Introduction

node-rnr

Record & Replay HTTP streams by node.js

Software License Issues JavaScript Style Guide NPM

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

node-rnr's People

Contributors

differui avatar iureffid avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.