http

package
v1.9.4-hotfix2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 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) RemoveHopHeaders added in v1.9.4

func (f Filter) RemoveHopHeaders(h http.Header)

RemoveHopHeaders removes hop-by-hop headers from http.Header 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