Code Monkey home page Code Monkey logo

delaying-proxy's Introduction

Simple TCP proxy simulating delays in network

This simple proxy allows one to simulate different delays between different network nodes. Basic useful feature list:

  • Intuitive YAML based configuration.
  • Supports HTTP, HTTPS, and SQL Proxying.
  • Allows delaying (simulating) slow SQL servers.
  • Supports any TCP based Database interfaces e.g.MySQL, Oracle(tm) .
  • Dynamic changes in delay parameters via REST API.
  • Uses Netty for IO handling.
  • Uses WSO2 MSF4J for REST API publishing.
  • High performance, Low memory footprint, low CPU and resource usage.
  • Can run headless.

how to build

mvn clean install
mvn package

How to Run

The binaries are available at /modules/dist/target/delaying-proxy. You can copy entire content and distribute as you wish.

Go to "delaying-proxy" directory

Linux/Unix/OS-X

bin/proxy proxy-conf.yaml

Windows

bin\proxy.bat proxy-conf.yaml

YAML Configuration

Configurations are done with "proxy-conf.yaml".

proxies:
proxiesConfig:
  name: "My Sample Proxy"
  restApi:
      listenPort: 8090        # Port which REST API (MSF4J) listens(optional, default 8080)
      listenAddresses: "0.0.0.0"    # machine IP Addresses or Host names to listen (not supported)
  proxies:
      - name: "To WSO2 IS"    # Unique human readable name
        enable: true          # enable or disable this proxy
        type: TCP             # Proxy type, TCP or SQL
        in:                   # Inbound configuration
          port: 10080         # Inbound listening port
          host: localhost     # Inbound listening IP (currently all IPs)
        out:                  # Outbound configuration
          port: 80            # Remote port to be proxied
          host: www.google.lk # Remote host to be proxied
        delay:                # Delay configurations (only one delay set can be configured currently)
          match: all          # - Unused
          min: 10             # Minimum Delay in milliseconds
          avg: 30             # Average delay in milliseconds
          max: 130            # Maximum delay in milliseconds

The delay is randomized on average delay. However it will be in between min and max value.

REST API

Set min, max or average delay

http://<host>:<port>/configure/proxy/{index}/delay/{match}/<min|max|average>/{value}

e.g.

http://<host>:<port>/configure/proxy/0/delay/match/min/3

Sets the minimum delay 3 milliseconds for the proxy at index 0. ("match" term currently unused and can put any string.)

delaying-proxy's People

Contributors

rushmin avatar

Watchers

 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.