Documentation ¶
Index ¶
- func FakeCertificateByHost(caCert *x509.Certificate, caKey *rsa.PrivateKey, domain string) (tls.Certificate, error)
- func GetDefaultCAAndPriv() (*x509.Certificate, *rsa.PrivateKey, error)
- func GetDefaultCAAndPrivRaw() ([]byte, []byte)
- func GetDefaultCaAndKey() ([]byte, []byte, error)
- func GetDefaultCaFilePath() string
- func GetDefaultMITMCAAndPriv() (*x509.Certificate, *rsa.PrivateKey, error)
- func InitMITMCert()
- func NewRequestModifier(f minimartian.RequestModifierFunc) minimartian.RequestModifier
- func NewResponseModifier(f minimartian.ResponseModifierFunc) minimartian.ResponseModifier
- func Snapshot(s string, timeout time.Duration) ([]byte, *types.Type, error)
- func VerifySystemCertificate() error
- type ClientCertificationPair
- type MITMConfig
- func MITM_AppendDNSServers(servers ...string) MITMConfig
- func MITM_MergeOptions(b ...MITMConfig) MITMConfig
- func MITM_MutualTLSClient(crt, key []byte, cas ...[]byte) MITMConfig
- func MITM_ProxyAuth(username string, password string) MITMConfig
- func MITM_SetCaCertAndPrivKey(ca []byte, key []byte) MITMConfig
- func MITM_SetDNSServers(servers ...string) MITMConfig
- func MITM_SetDownstreamProxy(s string) MITMConfig
- func MITM_SetForceTextFrame(t bool) MITMConfig
- func MITM_SetGM(b bool) MITMConfig
- func MITM_SetGMOnly(b bool) MITMConfig
- func MITM_SetGMPrefer(b bool) MITMConfig
- func MITM_SetHTTP2(b bool) MITMConfig
- func MITM_SetHTTPRequestHijack(c func(isHttps bool, req *http.Request) *http.Request) MITMConfig
- func MITM_SetHTTPRequestHijackRaw(c func(isHttps bool, reqIns *http.Request, req []byte) []byte) MITMConfig
- func MITM_SetHTTPResponseHijackRaw(...) MITMConfig
- func MITM_SetHTTPResponseMirror(f func(bool, string, *http.Request, *http.Response, string)) MITMConfig
- func MITM_SetHTTPResponseMirrorInstance(...) MITMConfig
- func MITM_SetHijackedMaxContentLength(i int) MITMConfig
- func MITM_SetHostMapping(m map[string]string) MITMConfig
- func MITM_SetMaxContentLength(m int64) MITMConfig
- func MITM_SetTransparentHijackHTTPRequest(f MITMTransparentHijackHTTPRequestFunc) MITMConfig
- func MITM_SetTransparentHijackHTTPResponse(f MITMTransparentHijackHTTPResponseFunc) MITMConfig
- func MITM_SetTransparentHijackMode(t bool) MITMConfig
- func MITM_SetTransparentHijackRequest(f MITMTransparentHijackFunc) MITMConfig
- func MITM_SetTransparentHijackRequestManager(m *TransparentHijackManager) MITMConfig
- func MITM_SetTransparentHijackResponse(f MITMTransparentHijackFunc) MITMConfig
- func MITM_SetTransparentHijackedMirror(f MITMTransparentMirrorFunc) MITMConfig
- func MITM_SetTransparentHijackedMirrorHTTP(f MITMTransparentMirrorHTTPFunc) MITMConfig
- func MITM_SetTransparentMirror(f MITMTransparentMirrorFunc) MITMConfig
- func MITM_SetTransparentMirrorHTTP(f MITMTransparentMirrorHTTPFunc) MITMConfig
- func MITM_SetVia(s string) MITMConfig
- func MITM_SetWebsocketHijackMode(t bool) MITMConfig
- func MITM_SetWebsocketRequestHijackRaw(...) MITMConfig
- func MITM_SetWebsocketRequestMirrorRaw(f func(req []byte)) MITMConfig
- func MITM_SetWebsocketResponseHijackRaw(...) MITMConfig
- func MITM_SetWebsocketResponseMirrorRaw(f func(req []byte)) MITMConfig
- func MITM_SetXForwarded(b bool) MITMConfig
- type MITMServer
- func (m *MITMServer) Configure(options ...MITMConfig) error
- func (m *MITMServer) GetCaCert() []byte
- func (m *MITMServer) GetMartianProxy() *minimartian.Proxy
- func (m *MITMServer) GetMaxContentLength() int
- func (m *MITMServer) Serve(ctx context.Context, addr string) error
- func (m *MITMServer) ServeTransparentTLS(ctx context.Context, addr string) error
- type MITMTransparentHijackFunc
- type MITMTransparentHijackHTTPRequestFunc
- type MITMTransparentHijackHTTPResponseFunc
- type MITMTransparentMirrorFunc
- type MITMTransparentMirrorHTTPFunc
- type PKCS12Config
- type ProxyAuth
- type TransparentHijackManager
- func (t *TransparentHijackManager) Hijacked(isHttps bool, req []byte) []byte
- func (t *TransparentHijackManager) List() []string
- func (t *TransparentHijackManager) RemoveByHash(h string)
- func (t *TransparentHijackManager) SetHijackRequestForHost(re string, requsetFunc MITMTransparentHijackFunc) error
- func (t *TransparentHijackManager) SetHijackRequestForPath(re string, requestFunc MITMTransparentHijackFunc) error
- type WebSocketModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FakeCertificateByHost ¶ added in v1.3.3
func FakeCertificateByHost(caCert *x509.Certificate, caKey *rsa.PrivateKey, domain string) (tls.Certificate, error)
func GetDefaultCAAndPriv ¶
func GetDefaultCAAndPriv() (*x509.Certificate, *rsa.PrivateKey, error)
func GetDefaultCAAndPrivRaw ¶
func GetDefaultCaAndKey ¶
func GetDefaultCaFilePath ¶
func GetDefaultCaFilePath() string
func GetDefaultMITMCAAndPriv ¶ added in v1.3.3
func GetDefaultMITMCAAndPriv() (*x509.Certificate, *rsa.PrivateKey, error)
func InitMITMCert ¶
func InitMITMCert()
func NewRequestModifier ¶
func NewRequestModifier(f minimartian.RequestModifierFunc) minimartian.RequestModifier
request modifier
func NewResponseModifier ¶
func NewResponseModifier(f minimartian.ResponseModifierFunc) minimartian.ResponseModifier
response modifier
func VerifySystemCertificate ¶ added in v1.3.3
func VerifySystemCertificate() error
Types ¶
type ClientCertificationPair ¶
func NewClientCertificationPair ¶
func NewClientCertificationPair(crt, key []byte, cas ...[]byte) *ClientCertificationPair
type MITMConfig ¶
type MITMConfig func(server *MITMServer) error
config
func MITM_AppendDNSServers ¶
func MITM_AppendDNSServers(servers ...string) MITMConfig
func MITM_MergeOptions ¶
func MITM_MergeOptions(b ...MITMConfig) MITMConfig
func MITM_MutualTLSClient ¶
func MITM_MutualTLSClient(crt, key []byte, cas ...[]byte) MITMConfig
func MITM_ProxyAuth ¶
func MITM_ProxyAuth(username string, password string) MITMConfig
func MITM_SetCaCertAndPrivKey ¶
func MITM_SetCaCertAndPrivKey(ca []byte, key []byte) MITMConfig
func MITM_SetDNSServers ¶
func MITM_SetDNSServers(servers ...string) MITMConfig
func MITM_SetDownstreamProxy ¶
func MITM_SetDownstreamProxy(s string) MITMConfig
func MITM_SetForceTextFrame ¶
func MITM_SetForceTextFrame(t bool) MITMConfig
func MITM_SetGM ¶
func MITM_SetGM(b bool) MITMConfig
func MITM_SetGMOnly ¶
func MITM_SetGMOnly(b bool) MITMConfig
func MITM_SetGMPrefer ¶
func MITM_SetGMPrefer(b bool) MITMConfig
func MITM_SetHTTP2 ¶
func MITM_SetHTTP2(b bool) MITMConfig
func MITM_SetHijackedMaxContentLength ¶
func MITM_SetHijackedMaxContentLength(i int) MITMConfig
func MITM_SetHostMapping ¶ added in v1.2.3
func MITM_SetHostMapping(m map[string]string) MITMConfig
func MITM_SetMaxContentLength ¶ added in v1.2.8
func MITM_SetMaxContentLength(m int64) MITMConfig
func MITM_SetTransparentHijackHTTPRequest ¶
func MITM_SetTransparentHijackHTTPRequest(f MITMTransparentHijackHTTPRequestFunc) MITMConfig
func MITM_SetTransparentHijackHTTPResponse ¶
func MITM_SetTransparentHijackHTTPResponse(f MITMTransparentHijackHTTPResponseFunc) MITMConfig
func MITM_SetTransparentHijackMode ¶
func MITM_SetTransparentHijackMode(t bool) MITMConfig
func MITM_SetTransparentHijackRequest ¶
func MITM_SetTransparentHijackRequest(f MITMTransparentHijackFunc) MITMConfig
func MITM_SetTransparentHijackRequestManager ¶
func MITM_SetTransparentHijackRequestManager(m *TransparentHijackManager) MITMConfig
func MITM_SetTransparentHijackResponse ¶
func MITM_SetTransparentHijackResponse(f MITMTransparentHijackFunc) MITMConfig
func MITM_SetTransparentHijackedMirror ¶
func MITM_SetTransparentHijackedMirror(f MITMTransparentMirrorFunc) MITMConfig
func MITM_SetTransparentHijackedMirrorHTTP ¶
func MITM_SetTransparentHijackedMirrorHTTP(f MITMTransparentMirrorHTTPFunc) MITMConfig
func MITM_SetTransparentMirror ¶
func MITM_SetTransparentMirror(f MITMTransparentMirrorFunc) MITMConfig
func MITM_SetTransparentMirrorHTTP ¶
func MITM_SetTransparentMirrorHTTP(f MITMTransparentMirrorHTTPFunc) MITMConfig
func MITM_SetVia ¶
func MITM_SetVia(s string) MITMConfig
func MITM_SetWebsocketHijackMode ¶
func MITM_SetWebsocketHijackMode(t bool) MITMConfig
func MITM_SetWebsocketRequestMirrorRaw ¶
func MITM_SetWebsocketRequestMirrorRaw(f func(req []byte)) MITMConfig
func MITM_SetWebsocketResponseMirrorRaw ¶
func MITM_SetWebsocketResponseMirrorRaw(f func(req []byte)) MITMConfig
func MITM_SetXForwarded ¶
func MITM_SetXForwarded(b bool) MITMConfig
type MITMServer ¶
type MITMServer struct { DNSServers []string HostMapping map[string]string // contains filtered or unexported fields }
func NewMITMServer ¶
func NewMITMServer(options ...MITMConfig) (*MITMServer, error)
func (*MITMServer) Configure ¶
func (m *MITMServer) Configure(options ...MITMConfig) error
func (*MITMServer) GetCaCert ¶
func (m *MITMServer) GetCaCert() []byte
func (*MITMServer) GetMartianProxy ¶
func (m *MITMServer) GetMartianProxy() *minimartian.Proxy
func (*MITMServer) GetMaxContentLength ¶ added in v1.2.8
func (m *MITMServer) GetMaxContentLength() int
func (*MITMServer) ServeTransparentTLS ¶
func (m *MITMServer) ServeTransparentTLS(ctx context.Context, addr string) error
type PKCS12Config ¶
type TransparentHijackManager ¶
type TransparentHijackManager struct {
// contains filtered or unexported fields
}
func NewTransparentHijackManager ¶
func NewTransparentHijackManager() *TransparentHijackManager
func (*TransparentHijackManager) Hijacked ¶
func (t *TransparentHijackManager) Hijacked(isHttps bool, req []byte) []byte
func (*TransparentHijackManager) List ¶
func (t *TransparentHijackManager) List() []string
func (*TransparentHijackManager) RemoveByHash ¶
func (t *TransparentHijackManager) RemoveByHash(h string)
func (*TransparentHijackManager) SetHijackRequestForHost ¶
func (t *TransparentHijackManager) SetHijackRequestForHost( re string, requsetFunc MITMTransparentHijackFunc, ) error
func (*TransparentHijackManager) SetHijackRequestForPath ¶
func (t *TransparentHijackManager) SetHijackRequestForPath( re string, requestFunc MITMTransparentHijackFunc, ) error
type WebSocketModifier ¶
type WebSocketModifier struct { ProxyStr string ProxyGetter func() *minimartian.Proxy RequestHijackCallback func(req *http.Request) error ResponseHijackCallback func(req *http.Request, rsp *http.Response, rspRaw []byte) []byte // contains filtered or unexported fields }
func (*WebSocketModifier) ModifyRequest ¶
func (w *WebSocketModifier) ModifyRequest(req *http.Request) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.