Giter VIP home page Giter VIP logo

in-the-middle's Introduction

In The Middle

Stateful mock server

To record activities

Start In The Middle

go run main/main.go -record

Set browser's proxy to In The Middle's listening IP and port and start the activities.

To replay activities

go run main/main.go

Replaying recorded activities, In-The-Middle will load activities from stub.json from export folder.

Command line options

  • -record to start record mode. Default is false.
  • -ip <ip> to specify listening IP address. Default is 0.0.0.0.
  • -port <ip> to specify listening port. Default is 8080.
  • -export <path> to specify exporting directory. Default is ./fixtures.
  • -? to show options screen.

Dependencies

Use go get ./... to install all dependencies.

  • github.com/fatih/color
  • gopkg.in/elazarl/goproxy.v1
  • github.com/kr/pretty
  • gopkg.in/xmlpath.v1
  • github.com/jmoiron/jsonq

Examples

See examples directory for example.

Get Started

  1. Start in-the-middle in RECORD mode with default setting.
  2. Use curl --proxy http://localhost:8080 http://anyHTTPdomain to record request and response. You should see request and response in in-the-middle console log.
  3. Stop in-the-middle by Ctrl-C. File stub.json should be created in ./fixtures folder.
  4. Start in-the-middle in REPLAY mode with default setting.
  5. Use curl --proxy http://localhost:8080 http://anyHTTPdomain to get cached response. If request hits cache, you should see "Cache HIT" message in in-the-middle console. Otherwise, you should see "Cache MISSED" message.
  6. You can modify cached content by editing files in ./fixtures folder.

Github

https://github.com/chonla/in-the-middle

in-the-middle's People

Contributors

chonla avatar

Watchers

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