metadata

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package `metadata` has a struct that stores information captured by `proxyserver`. Package `fingerprint` uses these information to create fingerprints.

Index

Constants

This section is empty.

Variables

View Source
var (
	FingerproxyContextKey = &contextKey{"fingerproxy-metadata"}
)

Functions

This section is empty.

Types

type HTTP2FingerprintingFrames

type HTTP2FingerprintingFrames struct {
	// Data from SETTINGS frame
	Settings []Setting

	// Increment of WINDOW_UPDATE frame
	WindowUpdateIncrement uint32

	// PRIORITY frame(s)
	Priorities []Priority

	// HEADERS frame
	Headers []HeaderField
}

func (*HTTP2FingerprintingFrames) Marshal added in v1.2.0

func (f *HTTP2FingerprintingFrames) Marshal(maxPriorityFrames uint) string

TODO: add tests

func (*HTTP2FingerprintingFrames) String

func (f *HTTP2FingerprintingFrames) String() string

type Metadata

type Metadata struct {
	// ClientHelloRecord is the raw TLS ClientHello bytes that
	// include TLS record header and handshake header
	ClientHelloRecord []byte

	// ConnectionState represents the TLS connection state
	ConnectionState tls.ConnectionState

	// HTTP2Frames includes certain HTTP2 frames data
	HTTP2Frames HTTP2FingerprintingFrames
}

Metadata is the data we captured from the connection for fingerprinting. Currently only TLS ClientHello and certain HTTP2 frames included, more can be added in the future.

func FromContext

func FromContext(ctx context.Context) (*Metadata, bool)

func NewContext

func NewContext(ctx context.Context) (context.Context, *Metadata)

Jump to

Keyboard shortcuts

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