From 10540b3c03f538c37a5ed5e3a4da395f2dce4497 Mon Sep 17 00:00:00 2001 From: Leonid Bugaev Date: Sat, 1 Jun 2013 11:18:39 +0000 Subject: [PATCH] Added Vagrant configuration --- .gitignore | 1 + README.md | 134 ++++++++++++++++++++++++++-------------------------- Vagrantfile | 24 ++++++++++ 3 files changed, 92 insertions(+), 67 deletions(-) create mode 100644 .gitignore create mode 100644 Vagrantfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8000dd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vagrant diff --git a/README.md b/README.md index cc0338a..3694afb 100644 --- a/README.md +++ b/README.md @@ -1,67 +1,67 @@ -## About - -Gor is simple http traffic replication tool written in Go. -Its main goal to replay traffic from production servers to staging and dev environments. - - -Now you can test your code on real user sessions in an automated and repeatable fashion. -**No more falling down in production!** - -Gor consists of 2 parts: listener and replay servers. - -Listener catch http traffic from given port in real-time and send it to replay server via UDP. -Replay server forwards traffic to given address. - -## Basic example - -```bash -# Run on server you want to catch traffic. You can run it on all `web` machines. -sudo gor listen -p 80 -r replay.server.local:28020 - -# Replay server (replay.server.local). -gor replay -f http://staging.server -``` - -## Advanced use - -### Rate limiting -Replay server support rate limiting. It can be useful if you want forward only part of production traffic, not to overload staging environment. You can specify desired request per second using "|" operator after server address: - -``` -# staging.server not get more than 10 requests per second -gor replay -f "http://staging.server|10" -``` - -### Forward to multiple addresses - -You can forward traffic to multiple endpoints. Just separate addresses by coma. -``` -gor replay -f "http://staging.server|10" -``` - -## Additional help -``` -$ gor listen -h -Usage of ./bin/gor-linux: - -i="any": By default it try to listen on all network interfaces.To get list of interfaces run `ifconfig` - -p=80: Specify the http server port whose traffic you want to capture - -r="localhost:28020": Address of replay server. -``` - -``` -$ gor replay -h -Usage of ./bin/gor-linux: - -f="http://localhost:8080": http address to forward traffic. - You can limit requests per second by adding `|#{num}` after address. - If you have multiple addresses with different limits. For example: http://staging.example.com|100,http://dev.example.com|10 - -ip="0.0.0.0": ip addresses to listen on - -p=28020: specify port number -``` - -## FAQ - -### Why `gor listener` requires sudo or root access? -Listener works by sniffing traffic from given port. Its accessible only using sudo or root access. - -### Do you support all http request types? -Right now it support only "GET" requests. +## About + +Gor is simple http traffic replication tool written in Go. +Its main goal to replay traffic from production servers to staging and dev environments. + + +Now you can test your code on real user sessions in an automated and repeatable fashion. +**No more falling down in production!** + +Gor consists of 2 parts: listener and replay servers. + +Listener catch http traffic from given port in real-time and send it to replay server via UDP. +Replay server forwards traffic to given address. + +## Basic example + +```bash +# Run on server you want to catch traffic. You can run it on all `web` machines. +sudo gor listen -p 80 -r replay.server.local:28020 + +# Replay server (replay.server.local). +gor replay -f http://staging.server +``` + +## Advanced use + +### Rate limiting +Replay server support rate limiting. It can be useful if you want forward only part of production traffic, not to overload staging environment. You can specify desired request per second using "|" operator after server address: + +``` +# staging.server not get more than 10 requests per second +gor replay -f "http://staging.server|10" +``` + +### Forward to multiple addresses + +You can forward traffic to multiple endpoints. Just separate addresses by coma. +``` +gor replay -f "http://staging.server|10" +``` + +## Additional help +``` +$ gor listen -h +Usage of ./bin/gor-linux: + -i="any": By default it try to listen on all network interfaces.To get list of interfaces run `ifconfig` + -p=80: Specify the http server port whose traffic you want to capture + -r="localhost:28020": Address of replay server. +``` + +``` +$ gor replay -h +Usage of ./bin/gor-linux: + -f="http://localhost:8080": http address to forward traffic. + You can limit requests per second by adding `|#{num}` after address. + If you have multiple addresses with different limits. For example: http://staging.example.com|100,http://dev.example.com|10 + -ip="0.0.0.0": ip addresses to listen on + -p=28020: specify port number +``` + +## FAQ + +### Why `gor listener` requires sudo or root access? +Listener works by sniffing traffic from given port. Its accessible only using sudo or root access. + +### Do you support all http request types? +Right now it support only "GET" requests. diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..0744fba --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,24 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "precise32" + + config.vm.box_url = "http://files.vagrantup.com/precise32.box" + + config.vm.provision :shell, :inline => " + if which go >/dev/null; then + echo 'second run' + else + apt-get install -y curl vim git build-essential + curl https://go.googlecode.com/files/go1.1.linux-amd64.tar.gz > ~/go1.1.tar.gz + cd ~/ + tar xzf go1.1.tar.gz + + echo 'export GOROOT=$HOME/go' >> ~/.profile + echo 'export PATH=$PATH:$GOROOT/bin' >> ~/.profile + fi + " + + config.vm.synced_folder "~/.ssh", "/home/vagrant/.ssh" +end