New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

http-troll

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-troll

lightweight http reverse proxy to simulate faulty services/connections

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

http-troll

About

This tool is nice to simulate slow or fickle webservices. Once started, it provides you a HTTP endpoint pointing to your origin of choice.

You can configure random response times and a HTTP 503 response ratio.

Installation

npm install http-troll -g // <- global required

Usage

Start reverse proxy to example.com, listening on port 7000 with enabled access log.

troll http://example.com -p 7000 --access-log

Options

Usage: troll http://example.com [OPTIONS]

  -p, --port=ARG    port for proxy to listen on
  -l, --access-log  print access log
  -r, --replay      replays previously made calls
  -h, --help        display this help

Configure via console

Once the server is started, you can just start typing those commands. They will be applied immediately.

Set error rate to 50%

Just type in your terminal: 50%

Set response time delay to randomly 50-150ms

Just type in your terminal: 50,150

Stop the troll

Just type... ye you guess it: stop

Configure via HTTP

Once started, it can be configured via console or http api. These changes will be applied immediately.

set response time to 20 to 500ms

curl -H 'response-times: 20,500' http://localhost:7000/configure

set HTTP 503 ratio to 40%

curl -H 'error-503: 0.4' http://localhost:7000/configure

Keywords

troll

FAQs

Package last updated on 28 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts