mitm

package
v0.0.0-...-6b8208f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MITM

type MITM struct {
	ListenHTTPS bool   //开启 HTTPS 代理服务器
	HTTPAddr    string //HTTP listen addr
	HTTPSAddr   string //HTTPS listen addr
	TLSConf     *TLSConfig
	Print       bool //打印请求详情

	IsDirect  bool                                              //是否直连,不通过代理
	Scheduler func(req *http.Request) (proxy string, err error) //代理调度 func
	Filter    func(req *http.Request) error                     //请求鉴权、清洗、限流
	// contains filtered or unexported fields
}

MITM 中间人

func (*MITM) Dump

func (m *MITM) Dump(clientResponse http.ResponseWriter, clientRequest *http.Request)

Dump rt

func (*MITM) FakeCert

func (m *MITM) FakeCert(domain string) (*tls.Certificate, error)

FakeCert rt

func (*MITM) GenerateCA

func (m *MITM) GenerateCA() error

GenerateCA rt

func (*MITM) Init

func (m *MITM) Init()

Init mitm

func (*MITM) ServeHTTP

func (m *MITM) ServeHTTP()

type TLSConfig

type TLSConfig struct {
	PrivateKeyFile  string
	CertFile        string
	Organization    string
	CommonName      string
	ServerTLSConfig *tls.Config
}

TLSConfig TLS配置

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL