Giter Club home page Giter Club logo

goreplay-http-logger's Introduction

goreplay-http-logger

I needed a way to directly capture http traffic for use with GoReplay, and there did not seem to be an official method. As such, I wrote my own quick server to do the job. I may as well share it with the world as it has been useful to me. I did not do anything fancy here, just a simple cli argument configuration.

$ ./goreplay-http-logger --help
http log server
  -bind string
        HTTP bind address
  -log-file string
        Log file name with date (default "http-%Y%m%d.log")
  -port int
        HTTP port (default 8080)

Example Nginx config for mirroring requests:

upstream backend {
    server 127.0.0.1:8087;
}

upstream mirror_backend {
    server 127.0.0.1:8080;
}
server {
    listen       8086 default_server;
    server_name  localhost;

    # Send body to mirror.
    mirror_request_body on;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location / {
        mirror @mirror;
        proxy_pass http://backend;
    }

    location = @mirror {
        internal;
        proxy_pass http://mirror_backend$request_uri;
    }
}

goreplay-http-logger's People

Contributors

grmrgecko avatar

Watchers

 avatar  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.