httpparser

package
v2.0.0-alpha56 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

README

Http Package Documentation

The http package encompasses the parser and mapping logic required to read HTTP text messages and capture or stub the outputs. Utilized by the hooks package, it aids in redirecting outgoing calls for the purpose of recording or stubbing the outputs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fuzzymatch

func Fuzzymatch(tcsMocks []*models.Mock, reqBuff []byte, h *hooks.Hook) (bool, *models.Mock)

func HttpDecoder

func HttpDecoder(encoded string) ([]byte, error)

func HttpEncoder

func HttpEncoder(buffer []byte) string

func IsAsciiPrintable

func IsAsciiPrintable(s string) bool

func ProcessOutgoingHttp

func ProcessOutgoingHttp(request []byte, clientConn, destConn net.Conn, h *hooks.Hook, logger *zap.Logger, ctx context.Context)

Types

type HttpParser

type HttpParser struct {
	// contains filtered or unexported fields
}

func NewHttpParser

func NewHttpParser(logger *zap.Logger, h *hooks.Hook) *HttpParser

func (*HttpParser) OutgoingType

func (h *HttpParser) OutgoingType(buffer []byte) bool

IsOutgoingHTTP function determines if the outgoing network call is HTTP by comparing the message format with that of an HTTP text message.

func (*HttpParser) ProcessOutgoing

func (http *HttpParser) ProcessOutgoing(request []byte, clientConn, destConn net.Conn, ctx context.Context)

ProcessOutgoing implements proxy.DepInterface.

Jump to

Keyboard shortcuts

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