Git Product home page Git Product logo

mitmproxy's Introduction

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/kardianos/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/mitmproxy/main.go, you can add your own addon by call AddAddon method.

For more examples, please refer to examples

Web interface

Has a web interface to view requests and responses.

TODO

  • Support http2
  • Support parse websocket

License

MIT License

mitmproxy's People

Contributors

dna2github avatar kardianos avatar lewage59 avatar lqqyt2423 avatar pepesi avatar zhouyixun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.