<commit_before># Martian Proxy [![Build Status](https://travis-ci.org/google/martian.svg?branch=master)](https://travis-ci.org/google/martian)

Martian Proxy is a programmable HTTP proxy designed to be used for testing.

Martian is a great tool to use if you want to:

* Verify that all (or some subset) of requests are secure
* Mock external services at the network layer
* Inject headers, modify cookies or perform other mutations of HTTP requests
  and responses
* Verify that pingbacks happen when you think they should
* Unwrap encrypted traffic (requires install of CA certificate in browser)

By taking advantage of Go cross-compilation, Martian can be deployed
anywhere that Go can target.

## Requirements

Go 1.6

## Getting Started

### Installation
Martian Proxy can be installed using `go install`

    go get github.com/google/martian/ && \
    go install github.com/google/martian/cmd/proxy

### Start the Proxy
Assuming you've installed Martian, running the proxy is as simple as

    $GOPATH/bin/proxy

If you want to see system logs as Martian is running, pass in the verbosity
flag:

    $GOPATH/bin/proxy -v=2

By default, Martian will be running on port 8080, and the Martian API will be running on 8181
. The port can be specified via flags:

    $GOPATH/bin/proxy -addr=:9999 -api_addr=:9898 

### Logging
For logging of requests and responses a [logging
modifier](https://github.com/google/martian/wiki/Modifier-Reference#logging) is
available or [HAR](http://www.softwareishard.com/blog/har-12-spec/) logs are
available if the `-har` flag is used.

#### HAR Logging
To enable HAR logging in Martian call the binary with the `-har` flag:

    $GOPATH/bin/proxy -har

If the `-har` flag has been enabled two HAR related endpoints will be
available:<commit_msg>Update README.md (#179)<commit_after># Martian Proxy [![Build Status](https://travis-ci.org/google/martian.svg?branch=master)](https://travis-ci.org/google/martian)

Martian Proxy is a programmable HTTP proxy designed to be used for testing.

Martian is a great tool to use if you want to:

* Verify that all (or some subset) of requests are secure
* Mock external services at the network layer
* Inject headers, modify cookies or perform other mutations of HTTP requests
  and responses
* Verify that pingbacks happen when you think they should
* Unwrap encrypted traffic (requires install of CA certificate in browser)

By taking advantage of Go cross-compilation, Martian can be deployed
anywhere that Go can target.

## Requirements

Go 1.6

## Getting Started

### Installation
Martian Proxy can be installed using `go install`

    go get github.com/google/martian/ && \
    go install github.com/google/martian/cmd/proxy

### Start the Proxy
Assuming you've installed Martian, running the proxy is as simple as

    $GOPATH/bin/proxy

If you want to see system logs as Martian is running, pass in the verbosity
flag:

    $GOPATH/bin/proxy -v=2

By default, Martian will be running on port 8080, and the Martian API will be running on 8181
. The port can be specified via flags:

    $GOPATH/bin/proxy -addr=:9999 -api-addr=:9898 

### Logging
For logging of requests and responses a [logging
modifier](https://github.com/google/martian/wiki/Modifier-Reference#logging) is
available or [HAR](http://www.softwareishard.com/blog/har-12-spec/) logs are
available if the `-har` flag is used.

#### HAR Logging
To enable HAR logging in Martian call the binary with the `-har` flag:

    $GOPATH/bin/proxy -har

If the `-har` flag has been enabled two HAR related endpoints will be
available:
{'fraction_non_alphanumeric': 0.08305369127516779, 'fraction_numerical': 0.012583892617449664, 'mean_word_length': 4.102710413694722, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '549547', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1036, 'n_words': 457}