http

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPResponseWriter

func NewHTTPResponseWriter(conn net.Conn) http.ResponseWriter

Types

type Server

type Server struct {
	// bind is the address to listen on
	Bind string

	Listener net.Listener

	// ProxyDial specifies the optional proxyDial function for
	// establishing the transport connection.
	ProxyDial statute.ProxyDialFunc
	// UserConnectHandle gives the user control to handle the TCP CONNECT requests
	UserConnectHandle statute.UserConnectHandler
	// Logger error log
	Logger *slog.Logger
	// Context is default context
	Context context.Context
	// BytesPool getting and returning temporary bytes for use by io.CopyBuffer
	BytesPool statute.BytesPool
}

func NewServer

func NewServer(options ...ServerOption) *Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) ServeConn

func (s *Server) ServeConn(conn net.Conn) error

type ServerOption

type ServerOption func(*Server)

func WithBind

func WithBind(bindAddress string) ServerOption

func WithBytesPool

func WithBytesPool(bytesPool statute.BytesPool) ServerOption

func WithConnectHandle

func WithConnectHandle(handler statute.UserConnectHandler) ServerOption

func WithContext

func WithContext(ctx context.Context) ServerOption

func WithLogger

func WithLogger(logger *slog.Logger) ServerOption

func WithProxyDial

func WithProxyDial(proxyDial statute.ProxyDialFunc) ServerOption

Jump to

Keyboard shortcuts

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