http

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ClientSettings
}

func NewClient

func NewClient(settings ClientSettings) *Client

NewClient create a new http client based on the given config.

func (*Client) HandleFlow

func (c *Client) HandleFlow(ctx context.Context, dst net.Destination, rw buf.ReaderWriter) error

Process implements proxy.Outbound.Process. We first create a socket tunnel via HTTP CONNECT method, then redirect all inbound traffic to that tunnel.

func (*Client) HandlePacketConn

func (c *Client) HandlePacketConn(ctx context.Context, dst net.Destination, pc udp.PacketReaderWriter) error

func (*Client) ListenPacket

func (c *Client) ListenPacket(ctx context.Context, dst net.Destination) (udp.UdpConn, error)

func (*Client) ProxyDial

func (c *Client) ProxyDial(ctx context.Context, dst net.Destination, initialData buf.MultiBuffer) (i.FlowConn, error)

type ClientSettings

type ClientSettings struct {
	Address            net.Address
	PortPicker         i.PortSelector
	Account            *proxyconfig.Account
	H1SkipWaitForReply bool
	Dialer             i.Dialer
}

type Server

type Server struct {
	ServerSettings
}

Server is an HTTP proxy server.

func NewServer

func NewServer(settings ServerSettings) *Server

NewServer creates a new HTTP inbound handler.

func (*Server) Network

func (*Server) Network() []net.Network

Network implements proxy.Inbound.

func (*Server) Process

func (s *Server) Process(ctx context.Context, conn net.Conn) error

type ServerSettings

type ServerSettings struct {
	PolicyManager    i.TimeoutSetting
	Handler          i.Handler
	AllowTransparent bool
}

Jump to

Keyboard shortcuts

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