http

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServerSpokeFirst = errors.New("server-speaks-first protocols are not supported by this HTTP proxy client implementation")

Functions

func NewHttpStreamClientReadWriter

func NewHttpStreamClientReadWriter(rw zerocopy.DirectReadWriteCloser, targetAddr conn.Addr) (*direct.DirectStreamReadWriter, error)

NewHttpStreamClientReadWriter writes a HTTP/1.1 CONNECT request to rw and wraps rw into a ReadWriter ready for use.

func NewHttpStreamServerReadWriter

func NewHttpStreamServerReadWriter(rw zerocopy.DirectReadWriteCloser, logger *zap.Logger) (*direct.DirectStreamReadWriter, conn.Addr, error)

NewHttpStreamServerReadWriter handles a HTTP request from rw and wraps rw into a ReadWriter ready for use.

Types

type ProxyClient

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

ProxyClient implements the zerocopy TCPClient interface.

func NewProxyClient

func NewProxyClient(name, network, address string, dialer conn.Dialer) *ProxyClient

func (*ProxyClient) Dial

func (c *ProxyClient) Dial(ctx context.Context, targetAddr conn.Addr, payload []byte) (rawRW zerocopy.DirectReadWriteCloser, rw zerocopy.ReadWriter, err error)

Dial implements the zerocopy.TCPClient Dial method.

func (*ProxyClient) Info added in v1.6.0

Info implements the zerocopy.TCPClient Info method.

type ProxyServer

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

ProxyServer implements the zerocopy TCPServer interface.

func NewProxyServer

func NewProxyServer(logger *zap.Logger) *ProxyServer

func (*ProxyServer) Accept

func (s *ProxyServer) Accept(rawRW zerocopy.DirectReadWriteCloser) (rw zerocopy.ReadWriter, targetAddr conn.Addr, payload []byte, username string, err error)

Accept implements the zerocopy.TCPServer Accept method.

func (*ProxyServer) Info added in v1.6.0

Info implements the zerocopy.TCPServer Info method.

Jump to

Keyboard shortcuts

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