http

package
v0.16.11 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 40 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Decoder = &decoder.StreamDecoder{
	Type:        types.Type_NC_HTTP,
	Name:        "HTTP",
	Description: "The Hypertext Transfer Protocol is powering the world wide web",
	PostInit: func(sd *decoder.StreamDecoder) error {
		var err error
		httpLog, _, err = logging.InitZapLogger(
			decoderconfig.Instance.Out,
			"http",
			decoderconfig.Instance.Debug,
		)
		if err == nil {
			software.InitializeWebtech()
		}
		return err
	},

	Specificity: core.SpecificityStructural,

	CanDecode: func(client, server []byte) bool {
		if bytes.HasPrefix(client, []byte(http2.ClientPreface)) || bytes.HasPrefix(server, []byte(http2.ClientPreface)) {
			return true
		}
		return containsHTTPMethod(client) || containsHTTPMethod(server) || containsHTTPProtocolName(server) || containsHTTPProtocolName(client) || (httpStart(client, false) >= 0 && httpStart(server, true) >= 0) || (httpStart(server, false) >= 0 && httpStart(client, true) >= 0)
	},
	DeInit: func(sd *decoder.StreamDecoder) error {
		return httpLog.Sync()
	},
	Factory: &httpReader{},
	Typ:     core.All,
}

Decoder for protocol analysis and writing audit records to disk.

Functions

func ResetHTTPStore

func ResetHTTPStore()

ResetHTTPStore clears the HTTP meta store This should be called when resetting state between processing different files

Types

type HTTPFileExtractor

type HTTPFileExtractor struct{}

HTTPFileExtractor implements file extraction for HTTP transfers

func (*HTTPFileExtractor) DescribeFile

func (h *HTTPFileExtractor) DescribeFile(handle *file.FileHandle) string

DescribeFile returns a human-readable description of the HTTP file transfer

func (*HTTPFileExtractor) ExtractFile

func (h *HTTPFileExtractor) ExtractFile(conv *core.ConversationInfo, data []byte, metadata file.FileMetadata) error

ExtractFile performs HTTP file extraction with enhanced metadata

func (*HTTPFileExtractor) GetFileHandle

func (h *HTTPFileExtractor) GetFileHandle(conv *core.ConversationInfo, isOrigin bool, depth int) string

GetFileHandle generates a unique identifier for an HTTP file transfer

func (*HTTPFileExtractor) ProtocolName

func (h *HTTPFileExtractor) ProtocolName() string

ProtocolName returns the protocol name

Jump to

Keyboard shortcuts

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