Documentation ¶
Overview ¶
Package martianhttp provides HTTP handlers for managing the state of a martian.Proxy.
Index ¶
- func NewAuthorityHandler(ca *x509.Certificate) http.Handler
- type Modifier
- func (m *Modifier) ModifyRequest(req *http.Request) error
- func (m *Modifier) ModifyResponse(res *http.Response) error
- func (m *Modifier) ResetRequestVerifications()
- func (m *Modifier) ResetResponseVerifications()
- func (m *Modifier) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (m *Modifier) SetRequestModifier(reqmod martian.RequestModifier)
- func (m *Modifier) SetResponseModifier(resmod martian.ResponseModifier)
- func (m *Modifier) VerifyRequests() error
- func (m *Modifier) VerifyResponses() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthorityHandler ¶
func NewAuthorityHandler(ca *x509.Certificate) http.Handler
NewAuthorityHandler returns an http.Handler that will present the client with the CA certificate to use in browser.
Types ¶
type Modifier ¶
type Modifier struct {
// contains filtered or unexported fields
}
Modifier is a locking modifier that is configured via http.Handler.
func (*Modifier) ModifyRequest ¶
ModifyRequest runs reqmod.
func (*Modifier) ModifyResponse ¶
ModifyResponse runs resmod.
func (*Modifier) ResetRequestVerifications ¶
func (m *Modifier) ResetRequestVerifications()
ResetRequestVerifications resets verifications on reqmod, iff reqmod is a RequestVerifier.
func (*Modifier) ResetResponseVerifications ¶
func (m *Modifier) ResetResponseVerifications()
ResetResponseVerifications resets verifications on resmod, iff resmod is a ResponseVerifier.
func (*Modifier) ServeHTTP ¶
func (m *Modifier) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP accepts a POST request with a body containing a modifier as a JSON message and updates the contained reqmod and resmod with the parsed modifier.
func (*Modifier) SetRequestModifier ¶
func (m *Modifier) SetRequestModifier(reqmod martian.RequestModifier)
SetRequestModifier sets the request modifier.
func (*Modifier) SetResponseModifier ¶
func (m *Modifier) SetResponseModifier(resmod martian.ResponseModifier)
SetResponseModifier sets the response modifier.
func (*Modifier) VerifyRequests ¶
VerifyRequests verifies reqmod, iff reqmod is a RequestVerifier.
func (*Modifier) VerifyResponses ¶
VerifyResponses verifies resmod, iff resmod is a ResponseVerifier.