http

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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

View Source
var ProtocolPortMap = map[string]uint16{
	"http":  80,
	"https": 443,
}

Functions

func BuildRemoteRequest added in v1.8.4

func BuildRemoteRequest(r *http.Request) (*transport.Request, error)

func ServeError added in v1.8.4

func ServeError(w io.Writer, err 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 Server

type Server struct {
	Ctx context.Context
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Handle added in v1.8.4

func (s *Server) Handle(w http.ResponseWriter, r *http.Request)

func (*Server) ListenAndServe

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

Jump to

Keyboard shortcuts

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