Giter Site home page Giter Site logo

gameanalytics / har_redbug Goto Github PK

View Code? Open in Web Editor NEW
11.0 9.0 0.0 10 KB

Trace an Erlang node and write HTTP requests to a file in HAR format

License: MIT License

Erlang 99.25% Makefile 0.75%
erlang elixir phoenix-framework cowboy http debugging hackney maru

har_redbug's Introduction

har_redbug

Build Status

Attach to an Erlang node, trace both incoming and outgoing HTTP requests, and write a file in HAR format.

HAR files can be viewed in popular web browsers: open developer tools, select the "Network" tab, and drag and drop the HAR file into the window. You can also use the HTTP Archive Viewer Chrome extension.

The purpose of this tool is to get a transcript of HTTP requests for development, debugging, and documentation. It is possible to achieve something similar by capturing network traffic using e.g. tcpdump or Wireshark, but that doesn't work as well when connections are encrypted.

As the name implies, this tool is based on redbug.

Currently supported:

  • cowboy 1 and 2 (incoming requests)
  • shotgun (outgoing requests)
  • hackney (outgoing requests)

Build

$ rebar3 compile && rebar3 escriptize

This generates an escript archive in _build/default/bin/har_redbug. The archive is path-independent, so you can move it wherever you want. It only contains BEAM files, so it is platform-independent: you can run it anywhere you have escript in the path.

Run

$ _build/default/bin/har_redbug NODENAME -cookie COOKIE -msgs 1000 -time 15000

That is, connect to NODENAME with the given cookie, and collect data until 1000 trace messages have been received or 15 seconds have passed, whichever comes first.

The output is written to redbug.har in the current directory.

har_redbug's People

Contributors

legoscia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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