Total Pageviews

Saturday, 14 August 2021

http Proxy服务器程序Martian

 

Build Status

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.

Latest Version

v3.0.0

Requirements

Go 1.11

Go Modules Support

Martian Proxy added support for Go modules since v3.0.0. If you use a Go version that does not support modules, this will break you. The latest version without Go modules support was tagged v2.1.0.

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
(cd $GOPATH
go get -u -v github.com/google/martian/cmd/proxy/
mv $GOPATH/bin/proxy $GOPATH/bin/martian)

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=127.0.0.1:9999
from https://github.com/google/martian

No comments:

Post a Comment