httpctx

package
v1.2.7-sp1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQUEST_CONTEXT_KEY_IsHttps                      = "isHttps"
	REQUEST_CONTEXT_KEY_IsDropped                    = "isRequestDropped"
	RESPONSE_CONTEXT_KEY_IsDropped                   = "isResponseDropped"
	RESPONSE_CONTEXT_NOLOG                           = "isResponseNoLog"
	REQUEST_CONTEXT_KEY_AutoFoward                   = "isRequestAutoForward"
	RESPONSE_CONTEXT_KEY_AutoFoward                  = "isResponseAutoForward"
	REQUEST_CONTEXT_KEY_Url                          = "url"
	REQUEST_CONTEXT_KEY_RequestIsModified            = "requestIsModified"
	REQUEST_CONTEXT_KEY_ResponseIsModified           = "responseIsModified"
	REQUEST_CONTEXT_KEY_RequestModifiedBy            = "requestIsModifiedBy"
	REQUEST_CONTEXT_KEY_ResponseModifiedBy           = "responseIsModifiedBy"
	REQUEST_CONTEXT_KEY_RequestIsFiltered            = "requestIsFiltered"
	RESPONSE_CONTEXT_KEY_ResponseIsFiltered          = "responseIsFiltered"
	REQUEST_CONTEXT_KEY_RequestIsViewedByUser        = "requestIsHijacked"
	REQUEST_CONTEXT_KEY_ResponseIsViewedByUser       = "responseIsHijacked"
	REQUEST_CONTEXT_KEY_RequestBareBytes             = "requestBareBytes"
	REQUEST_CONTEXT_KEY_RequestHijackedBytes         = "requestHijackedBytes"
	REQUEST_CONTEXT_KEY_RequestPlainBytes            = "requestPlainBytes"
	REQUEST_CONTEXT_KEY_ResponseBareBytes            = "responseBareBytes"
	REQUEST_CONTEXT_KEY_ResponsePlainBytes           = "responsePlainBytes"
	REQUEST_CONTEXT_KEY_ResponseHijackedBytes        = "responseHijackedBytes"
	REQUEST_CONTEXT_KEY_RequestIsStrippedGzip        = "requestIsStrippedGzip"
	RESPONSE_CONTEXT_KEY_ShouldBeHijackedFromRequest = "shouldBeHijackedFromRequest"
	REQUEST_CONTEXT_KEY_ConnectedTo                  = "connectedTo"
	REQUEST_CONTEXT_KEY_ConnectedToPort              = "connectedToPort"
	REQUEST_CONTEXT_KEY_ConnectedToHost              = "connectedToHost"
	REQUEST_CONTEXT_KEY_RemoteAddr                   = "remoteAddr"
	REQUEST_CONTEXT_KEY_ViaConnect                   = "viaConnect"

	// matched mitm rules
	REQUEST_CONTEXT_KEY_MatchedRules = "MatchedRules"
)
View Source
const REQUEST_CONTEXT_INFOMAP = "InfoMap"

Variables

This section is empty.

Functions

func AppendMatchedRule added in v1.2.6

func AppendMatchedRule(req *http.Request, rule ...*ypb.MITMContentReplacer)

func GetBareRequestBytes added in v1.2.6

func GetBareRequestBytes(r *http.Request) []byte

func GetBareResponseBytes added in v1.2.6

func GetBareResponseBytes(r *http.Request) []byte

func GetContextAnyFromRequest added in v1.2.6

func GetContextAnyFromRequest(r *http.Request, key string) any

func GetContextBoolInfoFromRequest

func GetContextBoolInfoFromRequest(r *http.Request, key string) bool

func GetContextInfoMap

func GetContextInfoMap(r *http.Request) *sync.Map

func GetContextIntInfoFromRequest

func GetContextIntInfoFromRequest(r *http.Request, key string) int

func GetContextStringInfoFromRequest

func GetContextStringInfoFromRequest(r *http.Request, key string) string

func GetHijackedRequestBytes added in v1.2.6

func GetHijackedRequestBytes(r *http.Request) []byte

func GetHijackedResponseBytes added in v1.2.6

func GetHijackedResponseBytes(r *http.Request) []byte

func GetMatchedRule added in v1.2.6

func GetMatchedRule(req *http.Request) []*ypb.MITMContentReplacer

func GetPlainRequestBytes added in v1.2.6

func GetPlainRequestBytes(r *http.Request) []byte

func GetPlainResponseBytes added in v1.2.6

func GetPlainResponseBytes(r *http.Request) []byte

func GetRemoteAddr added in v1.2.6

func GetRemoteAddr(r *http.Request) string

func GetRequestBytes

func GetRequestBytes(r *http.Request) []byte

func GetRequestHTTPS

func GetRequestHTTPS(r *http.Request) bool

func GetRequestIsModified added in v1.2.6

func GetRequestIsModified(req *http.Request) bool

func GetRequestURL added in v1.2.6

func GetRequestURL(req *http.Request) string

func GetRequestViaCONNECT added in v1.2.7

func GetRequestViaCONNECT(req *http.Request) bool

func GetRequestViewedByUser added in v1.2.6

func GetRequestViewedByUser(req *http.Request) bool

func GetResponseIsModified added in v1.2.6

func GetResponseIsModified(req *http.Request) bool

func GetResponseViewedByUser added in v1.2.6

func GetResponseViewedByUser(req *http.Request) bool

func SetBareRequestBytes added in v1.2.6

func SetBareRequestBytes(r *http.Request, bytes []byte)

func SetBareResponseBytes added in v1.2.6

func SetBareResponseBytes(r *http.Request, bytes []byte)

func SetContextValueInfoFromRequest

func SetContextValueInfoFromRequest(r *http.Request, key string, value any)

func SetHijackedRequestBytes added in v1.2.6

func SetHijackedRequestBytes(r *http.Request, bytes []byte)

func SetHijackedResponseBytes added in v1.2.6

func SetHijackedResponseBytes(r *http.Request, bytes []byte)

func SetMatchedRule added in v1.2.6

func SetMatchedRule(req *http.Request, rule []*ypb.MITMContentReplacer)

func SetPlainRequestBytes added in v1.2.6

func SetPlainRequestBytes(r *http.Request, bytes []byte)

func SetPlainResponseBytes added in v1.2.6

func SetPlainResponseBytes(r *http.Request, bytes []byte)

func SetRemoteAddr added in v1.2.6

func SetRemoteAddr(r *http.Request, addr string)

func SetRequestHTTPS

func SetRequestHTTPS(r *http.Request, b bool)

func SetRequestModified added in v1.2.6

func SetRequestModified(req *http.Request, by ...string)

func SetRequestURL added in v1.2.6

func SetRequestURL(req *http.Request, urlStr string)

func SetRequestViaCONNECT added in v1.2.7

func SetRequestViaCONNECT(req *http.Request, b bool)

func SetRequestViewedByUser added in v1.2.6

func SetRequestViewedByUser(req *http.Request)

func SetResponseModified added in v1.2.6

func SetResponseModified(req *http.Request, by ...string)

func SetResponseViewedByUser added in v1.2.6

func SetResponseViewedByUser(req *http.Request)

Types

This section is empty.

Jump to

Keyboard shortcuts

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