packet

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpPacket

type HttpPacket struct {
	Id       [16]byte `json:"id"`
	Hostname string
	Method   string
	Status   string
	Path     string
	// The request protocol version, i.e. "HTTP/1.1"
	// The response protocol version, i.e. "HTTP/1.1"
	ReqProto    string
	RespProto   string
	RespHeaders map[string][]string
	RespBody    []byte
	ReqHeaders  map[string][]string
	ReqBody     []byte
}

HttpPacket represents a captured packet from either the https or http proxy. An HttpPacket contains all the information from the http request, as well as the information from the http response (once it has been captured).

func CreatePacket

func CreatePacket(
	hostname string,
	method string,
	status string,
	path string,
	respProto string,
	reqProto string,
	respHeaders map[string][]string,
	respBody []byte,
	reqHeaders map[string][]string,
	reqBody []byte,
) HttpPacket

func FindPacket

func FindPacket(toFind *HttpPacket, packets []*HttpPacket) *HttpPacket

func (*HttpPacket) FormatRequestContent added in v0.13.0

func (p *HttpPacket) FormatRequestContent() string

func (*HttpPacket) FormatResponseContent added in v0.13.0

func (p *HttpPacket) FormatResponseContent() string

func (*HttpPacket) UpdatePacket

func (p *HttpPacket) UpdatePacket(inPacket *HttpPacket)

Jump to

Keyboard shortcuts

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