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.
go-mitmproxy/README.md

83 lines
2.4 KiB
Markdown

# go-mitmproxy
3 years ago
[简体中文](./README_CN.md)
4 years ago
3 years ago
[Mitmproxy](https://mitmproxy.org/) implemented with golang. Intercept HTTP & HTTPS requests and responses and modify them.
4 years ago
3 years ago
## Features
4 years ago
3 years ago
- 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](https://mitmproxy.org/), 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 [addon/addon.go](./addon/addon.go)
- 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
4 years ago
3 years ago
## Install
4 years ago
```
GO111MODULE=on go get -u github.com/lqqyt2423/go-mitmproxy/cmd/go-mitmproxy
4 years ago
```
3 years ago
## Usage
4 years ago
3 years ago
### Startup
3 years ago
```
go-mitmproxy
4 years ago
```
3 years ago
After startup, the HTTP proxy address defaults to port 9080, and the web interface defaults to port 9081.
3 years ago
3 years ago
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](https://docs.mitmproxy.org/stable/concepts-certificates/).
3 years ago
3 years ago
### Help
3 years ago
```
Usage of go-mitmproxy:
4 years ago
-addr string
proxy listen addr (default ":9080")
-dump string
dump filename
-dump_level int
dump level: 0 - header, 1 - header + body
3 years ago
-mapper_dir string
mapper files dirpath
-ssl_insecure
not verify upstream server SSL/TLS certificates.
3 years ago
-version
show version
4 years ago
-web_addr string
web interface listen addr (default ":9081")
-cert_path string
path of generate cert files
4 years ago
```
3 years ago
## Usage as package
Refer to [cmd/go-mitmproxy/main.go](./cmd/go-mitmproxy/main.go), you can add your own addon by call `AddAddon` method.
4 years ago
3 years ago
For more examples, please refer to [examples](./examples)
3 years ago
3 years ago
## Web interface
3 years ago
![](./assets/web-1.png)
![](./assets/web-2.png)
![](./assets/web-3.png)
4 years ago
## TODO
3 years ago
- [ ] Support http2
- [ ] Support parse websocket
4 years ago
## License
[MIT License](./LICENSE)