http

package
v1.8.2-1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MessageConnectionEstablished = []byte("HTTP/1.1 200 Connection established" + CRLF)
	MessageServiceUnavailable    = []byte("HTTP/1.1 503 Service Unavailable" + CRLF)
)
View Source
var CRLF = "\r\n"

CRLF used for delimiter purpose, may be incompatible in some old programs

View Source
var ErrDelimiterNotFound = errors.New("delimiter not found")
View Source
var ProtocolMap = map[string]uint16{
	"http":  80,
	"https": 443,
}

Functions

func ParseRawParamsFromUrl

func ParseRawParamsFromUrl(scheme bool, url string) (string, error)

Types

type Filter

type Filter []string

func (Filter) Filter

func (f Filter) Filter(s string) bool

Filter checks if given header needed to be filtered note that only the request which not CONNECT one needs to do this

type Forwarder

type Forwarder struct {
	Ctx  context.Context
	Conn net.Conn
	// contains filtered or unexported fields
}

func (*Forwarder) Forward

func (f *Forwarder) Forward() error

type Request

type Request struct {
	Method string
	Host   string
	Params string
	Port   uint16
}

func ParseRequestFromRaw

func ParseRequestFromRaw(raw string) (*Request, error)

ParseRequestFromRaw parses request from raw tcp message

func (*Request) UnpackIPv6

func (r *Request) UnpackIPv6()

type Server

type Server struct {
	Ctx      context.Context
	Listener net.Listener
}

func New

func New(ctx context.Context) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(network, addr string) error

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) ServeConn

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

Jump to

Keyboard shortcuts

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