crep

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: AGPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultCAAndPriv

func GetDefaultCAAndPriv() (*x509.Certificate, *rsa.PrivateKey, error)

func GetDefaultCAAndPrivRaw

func GetDefaultCAAndPrivRaw() ([]byte, []byte)

func GetDefaultCaAndKey

func GetDefaultCaAndKey() ([]byte, []byte, error)

func GetDefaultCaFilePath

func GetDefaultCaFilePath() string

func InitMITMCert

func InitMITMCert()

func NewRequestModifier

request modifier

func NewResponseModifier

response modifier

func Snapshot

func Snapshot(s string, timeout time.Duration) ([]byte, *types.Type, error)

Types

type ClientCertificationPair

type ClientCertificationPair struct {
	CrtPem []byte
	KeyPem []byte
	CaPem  [][]byte
}

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_SetHTTPRequestHijack

func MITM_SetHTTPRequestHijack(c func(isHttps bool, req *http.Request) *http.Request) MITMConfig

func MITM_SetHTTPRequestHijackRaw

func MITM_SetHTTPRequestHijackRaw(c func(isHttps bool, reqIns *http.Request, req []byte) []byte) MITMConfig

func MITM_SetHTTPResponseHijackRaw

func MITM_SetHTTPResponseHijackRaw(c func(isHttps bool, req *http.Request, rspInstance *http.Response, rsp []byte, remoteAddr string) []byte) MITMConfig

func MITM_SetHTTPResponseMirror

func MITM_SetHTTPResponseMirror(f func(bool, string, *http.Request, *http.Response, string)) MITMConfig

func MITM_SetHTTPResponseMirrorInstance

func MITM_SetHTTPResponseMirrorInstance(f func(isHttps bool, req, rsp []byte, remoteAddr string, response *http.Response)) 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_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_SetWebsocketRequestHijackRaw

func MITM_SetWebsocketRequestHijackRaw(c func(req []byte, r *http.Request, rspIns *http.Response, startTs int64) []byte) MITMConfig

func MITM_SetWebsocketRequestMirrorRaw

func MITM_SetWebsocketRequestMirrorRaw(f func(req []byte)) MITMConfig

func MITM_SetWebsocketResponseHijackRaw

func MITM_SetWebsocketResponseHijackRaw(c func(rsp []byte, r *http.Request, rspIns *http.Response, startTs int64) []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) Serve

func (m *MITMServer) Serve(ctx context.Context, addr string) error

func (*MITMServer) ServeTransparentTLS

func (m *MITMServer) ServeTransparentTLS(ctx context.Context, addr string) error

type MITMTransparentHijackFunc

type MITMTransparentHijackFunc func(isHttps bool, data []byte) []byte

type MITMTransparentHijackHTTPRequestFunc

type MITMTransparentHijackHTTPRequestFunc func(isHttps bool, data *http.Request) *http.Request

type MITMTransparentHijackHTTPResponseFunc

type MITMTransparentHijackHTTPResponseFunc func(isHttps bool, data *http.Response) *http.Response

type MITMTransparentMirrorFunc

type MITMTransparentMirrorFunc func(isHttps bool, req []byte, rsp []byte)

type MITMTransparentMirrorHTTPFunc

type MITMTransparentMirrorHTTPFunc func(isHttps bool, req *http.Request, rsp *http.Response)

type PKCS12Config

type PKCS12Config struct {
	Path     string
	Password string
}

type ProxyAuth

type ProxyAuth struct {
	Username string
	Password string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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