Skip to main content

A simple, logging, colorizing, pretty-formatting, HTTP proxy.

Project description

A simple HTTP proxy server that logs all client/server communications, with some added features to parse the content such as automatic gunzipping, output colorization and known data “pretty” formatting, including XML, JSON, and YAML.

Project

TL;DR

Install:

$ pip install proxylog

Proxy http://www.example.com/ locally to http://localhost:8080/, log all transactions to a file and display them colorized and formatted on the console:

$ proxylog -r www.example.com:80 -p 8080 -o transactions.log -dcf

Display a previous log file colorized and formatted:

$ proxylog -i transactions.log -dcf

Colorizing

The colorizing is done via the Pygments package; proxylog’s --theme option is passed through to pygments, so any of the color themes that pygments supports can be used. Use the following command to list the available themes:

$ pygmentize -L styles

Formatting

“Formatting” refers to proxylog’s ability to re-format known data formats to a more human-friendly display, which when combined with colorization, can yield very readable data. HOWEVER, this does alter the actual data, so if you are using the data in any way, you should not use the “–format” flag.

Currently, the following formats are supported, with examples of how they are “prettified”:

  • XML:

    Input:

    <root  ><node   attr= "value">data</node>
      </root>

    Formatted output:

    <root>
      <node attr="value">data</node>
    </root>
  • JSON:

    Input:

    {"key": "value", "list": [3, "bar", null, "foo"]}

    Formatted output:

    {
      "key": "value",
      "list": [
        3,
        "bar",
        null,
        "foo"
      ]
    }
  • YAML:

    Input:

    {key: value, list: [3, bar, null, foo]}

    Formatted output:

    {
      "key": "value",
      "list": [
        3,
        "bar",
        null,
        "foo"
      ]
    }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

proxylog-0.6b.tar.gz (23.0 kB view details)

Uploaded Source

File details

Details for the file proxylog-0.6b.tar.gz.

File metadata

  • Download URL: proxylog-0.6b.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for proxylog-0.6b.tar.gz
Algorithm Hash digest
SHA256 fa24cecf8f2730b266c4c17c6b4c443290e13b3a2ef64a4a76a620c841158f63
MD5 960df7a7d188d39406f4d50fb065d7ef
BLAKE2b-256 aa951e7b88b250ecb3cc38f9d06a85156b641a8d207793ff567200feec688198

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page