vhost

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHttpRequestInfo

func GetHttpRequestInfo(c frpNet.Conn) (_ frpNet.Conn, _ map[string]string, err error)

func GetHttpsHostname

func GetHttpsHostname(c frpNet.Conn) (sc frpNet.Conn, _ map[string]string, err error)

func HttpAuthFunc

func HttpAuthFunc(c frpNet.Conn, userName, passWord, authorization string) (bAccess bool, err error)

func HttpHostNameRewrite

func HttpHostNameRewrite(c frpNet.Conn, rewriteHost string) (_ frpNet.Conn, err error)

Types

type ByLocation

type ByLocation []*VhostRouter

sort by location

func (ByLocation) Len

func (a ByLocation) Len() int

func (ByLocation) Less

func (a ByLocation) Less(i, j int) bool

func (ByLocation) Swap

func (a ByLocation) Swap(i, j int)

type HttpMuxer

type HttpMuxer struct {
	*VhostMuxer
}

func NewHttpMuxer

func NewHttpMuxer(listener frpNet.Listener, timeout time.Duration) (*HttpMuxer, error)

type HttpsMuxer

type HttpsMuxer struct {
	*VhostMuxer
}

func NewHttpsMuxer

func NewHttpsMuxer(listener frpNet.Listener, timeout time.Duration) (*HttpsMuxer, error)

type Listener

type Listener struct {
	log.Logger
	// contains filtered or unexported fields
}

func (*Listener) Accept

func (l *Listener) Accept() (frpNet.Conn, error)

func (*Listener) Close

func (l *Listener) Close() error

func (*Listener) Name

func (l *Listener) Name() string

type VhostMuxer

type VhostMuxer struct {
	// contains filtered or unexported fields
}

func NewVhostMuxer

func NewVhostMuxer(listener frpNet.Listener, vhostFunc muxFunc, authFunc httpAuthFunc, rewriteFunc hostRewriteFunc, timeout time.Duration) (mux *VhostMuxer, err error)

func (*VhostMuxer) Listen

func (v *VhostMuxer) Listen(cfg *VhostRouteConfig) (l *Listener, err error)

listen for a new domain name, if rewriteHost is not empty and rewriteFunc is not nil then rewrite the host header to rewriteHost

type VhostRouteConfig

type VhostRouteConfig struct {
	Domain      string
	Location    string
	RewriteHost string
	Username    string
	Password    string
}

type VhostRouter

type VhostRouter struct {
	// contains filtered or unexported fields
}

type VhostRouters

type VhostRouters struct {
	RouterByDomain map[string][]*VhostRouter
	// contains filtered or unexported fields
}

func NewVhostRouters

func NewVhostRouters() *VhostRouters

func (*VhostRouters) Add

func (r *VhostRouters) Add(domain, location string, l *Listener)

func (*VhostRouters) Del

func (r *VhostRouters) Del(domain, location string)

func (*VhostRouters) Exist

func (r *VhostRouters) Exist(host, path string) (vr *VhostRouter, exist bool)

func (*VhostRouters) Get

func (r *VhostRouters) Get(host, path string) (vr *VhostRouter, exist bool)

Jump to

Keyboard shortcuts

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