http

package
Version: v0.0.0-...-d9ac036 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HttpPrefixLen = len("http://")
	HttpPort      = 80
	HttpsPort     = 443
)
View Source
const (
	RedirectFile = Rdt(iota)
	RedirectFolder
	RedirectCustom

	FallbackToSource = Fbt(iota)
	FallbackTo404
)
View Source
const RootCertificateName = "root"
View Source
const StoreDir = "easypki"

Variables

View Source
var (
	HopByHops = []string{"Proxy-Connection", "Connection", "Proxy-Authenticate", "Keep-Alive"}
)
View Source
var (
	HttpsPrefixLen = len("http://")
)
View Source
var (
	SslVersionMap = map[byte]string{
		0: "SSL 3.0",
		1: "TlS 1.0",
		2: "TlS 1.1",
		3: "TlS 1.2",
	}
)

Functions

func AddCustomMapping

func AddCustomMapping(expr, code, body, contentType string, headers map[string]string) (err error)

func AddFileMapping

func AddFileMapping(expr, target string, fbt Fbt) (err error)

func AddFolderMapping

func AddFolderMapping(expr, folder string, fbt Fbt)

func BuildFullUrl

func BuildFullUrl(protocol, host, path string) string

func DelCustomMapping

func DelCustomMapping(expr string)

func DelFileMapping

func DelFileMapping(expr string)

func DelFolderMapping

func DelFolderMapping(expr string)

func HandleHttp

func HandleHttp(acs *common.ACStream) (err error)

func HandleHttps

func HandleHttps(acs *common.ACStream) (err error)

func InitCertCache

func InitCertCache(cache string) (err error)

func InitHandler

func InitHandler(conf *common.Config)

func TrimHttpPrefix

func TrimHttpPrefix(url string) string

Types

type Fbt

type Fbt int8

type FileInfo

type FileInfo struct {
	Key         string
	Name        string
	Size        int
	ContentType string
}

type Rdt

type Rdt int8

type RedirectItem

type RedirectItem struct {
	Type        Rdt
	Url         string
	Target      string
	Headers     map[string]string
	Body        string
	ContentType string
	Fallback    Fbt
}

func GetMappedPath

func GetMappedPath(path string) *RedirectItem

type RequestInfo

type RequestInfo struct {
	Version     string
	Protocol    string
	Method      string
	Host        string
	FullUrl     string
	Url         string
	Headers     map[string]string
	Query       map[string]string
	WebForm     map[string]string
	Files       []*FileInfo
	ContentType string
	Body        []byte
}

type ResponseInfo

type ResponseInfo struct {
	Status      int
	Version     string
	Message     string
	BodySize    int
	ContextType string
	Headers     map[string]string
}

type SessionInfo

type SessionInfo struct {
	Sid          string
	BeginTime    time.Time
	EndTime      time.Time
	RemoteAddr   string
	RemotePort   int
	RequestInfo  *RequestInfo
	ResponseInfo *ResponseInfo
	Done         bool
	// contains filtered or unexported fields
}

func NewSessionInfo

func NewSessionInfo(conf *common.Config) *SessionInfo

func (*SessionInfo) SessionDone

func (s *SessionInfo) SessionDone()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL