vhost

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 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 added in v0.9.0

func GetHttpRequestInfo(c *conn.Conn) (_ net.Conn, _ map[string]string, err error)

func GetHttpsHostname

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

func HttpAuthFunc added in v0.9.0

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

func HttpHostNameRewrite

func HttpHostNameRewrite(c *conn.Conn, rewriteHost string) (_ net.Conn, err error)

Types

type ByLocation added in v0.9.1

type ByLocation []*VhostRouter

sort by location

func (ByLocation) Len added in v0.9.1

func (a ByLocation) Len() int

func (ByLocation) Less added in v0.9.1

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

func (ByLocation) Swap added in v0.9.1

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

type HttpMuxer

type HttpMuxer struct {
	*VhostMuxer
}

func NewHttpMuxer

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

type HttpsMuxer

type HttpsMuxer struct {
	*VhostMuxer
}

func NewHttpsMuxer

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

type Listener

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

func (*Listener) Accept

func (l *Listener) Accept() (*conn.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 *conn.Listener, vhostFunc muxFunc, authFunc httpAuthFunc, rewriteFunc hostRewriteFunc, timeout time.Duration) (mux *VhostMuxer, err error)

func (*VhostMuxer) Listen

func (v *VhostMuxer) Listen(name, location, rewriteHost, userName, passWord string) (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 VhostRouter added in v0.9.1

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

type VhostRouters added in v0.9.1

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

func NewVhostRouters added in v0.9.1

func NewVhostRouters() *VhostRouters

func (*VhostRouters) Add added in v0.9.1

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

func (*VhostRouters) Del added in v0.9.1

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

func (*VhostRouters) Exist added in v0.9.1

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

func (*VhostRouters) Get added in v0.9.1

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