1 comment

[ 5.3 ms ] story [ 7.5 ms ] thread
Hey HN!

This is yet another HTTP proxy written in Go so I'll try to be brief. :)

Martian was written to provide a solution for writing larger E2E tests that require custom behavior at the request/response layer.

For example, we've used it to spoof headers, redirect traffic to local fakes, and verify that all traffic coming to the backends is over HTTPS.

We wrote Martian so that others could build their own proxies to suit their own needs. Martian provides a Go API[0] for building custom behavior and a JSON API[1] that can be used to reconfigure the proxy at runtime. We provide a fair bit of custom modification and verification behavior out-of-the-box, such as header modification[2], URL verification[3], and filtering based on proxy credentials[4][5].

Check out the README and if it seems interesting feel free to ask questions or let us know what you think. :)

An example proxy binary is available in the examples directory[6] and can be run with `go run`. Note that it requires Go 1.5 due to some recent changes in crypto/tls we depend on for dynamically generating certs.

[0] https://github.com/google/martian/blob/master/martian.go

[1] https://github.com/google/martian/blob/master/parse/parse.go

[2] https://github.com/google/martian/blob/master/header/header_...

[3] https://github.com/google/martian/blob/master/martianurl/url...

[4] https://github.com/google/martian/blob/master/proxyauth/prox...

[5] https://github.com/google/martian/blob/master/auth/auth_filt...

[6] https://github.com/google/martian/blob/master/examples/main....