handler

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadBytes

func ReadBytes(conn *net.TCPConn, dest []byte) ([]byte, error)

ReadBytes reads bytes from the TCP connection into the provided destination buffer. It returns a slice of the data read and any error encountered.

Types

type HttpHandler

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

func NewHttpHandler

func NewHttpHandler(timeout int) *HttpHandler

NewHttpHandler creates a new HttpHandler instance with the given timeout.

func (*HttpHandler) Serve

func (h *HttpHandler) Serve(ctx context.Context, lConn *net.TCPConn, pkt *packet.HttpRequest, ip string)

Serve handles the HTTP request by establishing a connection to the requested server.

type HttpsHandler

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

func NewHttpsHandler

func NewHttpsHandler(
	timeout int,
	windowSize int,
	allowedPatterns []*regexp.Regexp,
	exploit bool,
) *HttpsHandler

NewHttpsHandler creates a new HttpsHandler instance with the given timeout, window size, allowed patterns, and exploit flag.

func (*HttpsHandler) Serve

func (h *HttpsHandler) Serve(
	ctx context.Context,
	lConn *net.TCPConn,
	initPkt *packet.HttpRequest,
	ip string,
)

Serve handles the HTTPS request by establishing a connection to the requested server.

Jump to

Keyboard shortcuts

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