main_test

package module
v0.0.0-...-48dec25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 31, 2017 License: MIT Imports: 3 Imported by: 0

README

The Shrike

The Shrike is a Layer 7 Chaos HTTP/WebSocket proxy that impales it's victims on the Tree of Pain. The Tree of Pain for this Shrike takes the form of Toxiproxy, an excellent TCP network tampering tool.

The Shrike is designed for resliliency testing a whole environment and has an API to route http path based traffic through an embedded Toxiproxy instance.

The Shrike currently assumes you've put it close at the edge of your service stack thus the current single upstream location which is assumed to be your gateway.

Path prefix matching is used to route differing paths for testing while unmatched paths are sent straight on to the gateway.

Configuration

Configuration is by both environment variables and command line flags with command line flags taking precedence.

Command line flags

-host is the address to bind to on the host. Defaults to 0.0.0.0.

-port is the proxy forwarder listen port to bind to on the host. Defaults to 8080.

-apiport is the api listen port to bind to on the host. Defaults to 8075.

-upstream is the upstream HTTP/WS proxy we are sitting in front of. Defaults to http://127.0.0.1.

Environment Variables

HOST is the address to bind to on the host. Defaults to 0.0.0.0.

PORT is the proxy forwarder listen port to bind to on the host. Defaults to 8080.

API_PORT is the api listen port to bind to on the host. Defaults to 8075.

UPSTREAM_URL is the upstream HTTP/WS proxy we are sitting in front of. Defaults to http://127.0.0.1.

PORT and API_PORT can be the same value and The Shrike proxy and api will be bound to the same port. This means that /ping and /routes* requests will be intercepted by Shrike and your Shrike control API may be exposed.

Develop

This project uses Go 1.8 or later and uses Glide for package management.

Linux
make
Mac
make mac

To add or update dependencies in the vendor folder, please use Glide:

curl https://glide.sh/get | sh # only necessary if you don't have Glide installed already.
glide install

Testing

Run the test suites with Ginkgo installed and get coverage output:

make ginkgo

Run the test suites without Ginkgo (less awesome output, no randomization of tests):

make test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestShrike

func TestShrike(t *testing.T)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL