You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
lqqyt2423 e21274c6e9 support ignore_hosts allow_hosts options 2 years ago
.github/workflows go-version: 1.18 3 years ago
addon code refactoring 3 years ago
assets readme 3 years ago
cert add some test 3 years ago
cmd support ignore_hosts allow_hosts options 2 years ago
examples code refactoring 3 years ago
proxy web addon optimization 2 years ago
web web addon optimization 2 years ago
.gitignore close connection correctly, try fix eof error 3 years ago
.goreleaser.yml upgrade version 3 years ago
LICENSE Create LICENSE 4 years ago
Makefile support ignore_hosts allow_hosts options 2 years ago
README.md fix readme 2 years ago
README_EN.md fix readme 2 years ago
go.mod go-version: 1.18 3 years ago
go.sum go mod tidy 3 years ago

README_EN.md

go-mitmproxy

简体中文

Mitmproxy implemented with golang. Intercept HTTP & HTTPS requests and responses and modify them.

Features

  • Intercept HTTP & HTTPS requests and responses and modify them on the fly
  • SSL/TLS certificates for interception are generated on the fly
  • Certificates logic compatible with mitmproxy, saved at ~/.mitmproxy. If you used mitmproxy before and installed certificates, then you can use this go-mitmproxy directly
  • Addon mechanism, you can add your functions easily, refer to examples
  • Performance advantages
    • Golang's inherent performance advantages
    • Forwarding and parsing HTTPS traffic in process memory without inter-process communication such as tcp port or unix socket
    • Use LRU cache when generating certificates of different domain names to avoid double counting
  • Support Wireshark to analyze traffic through the environment variable SSLKEYLOGFILE
  • Support streaming when uploading/downloading large files
  • Web interface

Install

go install github.com/lqqyt2423/go-mitmproxy/cmd/go-mitmproxy@latest

Usage

Startup

go-mitmproxy

After startup, the HTTP proxy address defaults to port 9080, and the web interface defaults to port 9081.

After the first startup, the SSL/TLS certificate will be automatically generated at ~/.mitmproxy/mitmproxy-ca-cert.pem. You can refer to this link to install: About Certificates.

Help

Usage of go-mitmproxy:
  -addr string
    	proxy listen addr (default ":9080")
  -cert_path string
    	path of generate cert files
  -debug int
    	debug mode: 1 - print debug log, 2 - show debug from
  -dump string
    	dump filename
  -dump_level int
    	dump level: 0 - header, 1 - header + body
  -mapper_dir string
    	mapper files dirpath
  -ssl_insecure
    	not verify upstream server SSL/TLS certificates.
  -version
    	show version
  -web_addr string
    	web interface listen addr (default ":9081")

Usage as package

Refer to cmd/go-mitmproxy/main.go, you can add your own addon by call AddAddon method.

For more examples, please refer to examples

Web interface

TODO

  • Support http2
  • Support parse websocket

License

MIT License