proxy

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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BufferSize = 1024
)

Variables

View Source
var ErrTimeout = errors.New("connection timed out")

Functions

func ReadBytes

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

ReadBytes reads bytes from the TCP connection and returns them.

func Serve

func Serve(
	ctx context.Context,
	from *net.TCPConn,
	to *net.TCPConn,
	proto string,
	fd string,
	td string,
	timeout int,
)

Serve pipes data between two TCP connections in one direction.

Types

type Handler

type Handler interface {
	Serve(ctx context.Context, lConn *net.TCPConn, pkt *packet.HttpRequest, ip string)
}

type Proxy

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

func New

func New(config *util.Config) *Proxy

func (*Proxy) Start

func (pxy *Proxy) Start(ctx context.Context)

Start starts the proxy server and listens for incoming connections.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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