Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Server)
Option sets various options for NewServer().
func WithClientIPHeader ¶ added in v1.10.0
WithClientIPHeader records the client address from the named proxy header in the website request log. The accepted values are utils.ClientIPHeaderForwardedFor and utils.ClientIPHeaderRealIP; an empty value (the default) keeps the socket peer address. The header is only honoured from a peer listed in WithTrustedProxies.
func WithSocketPerm ¶
WithSocketPerm sets the file-mode permissions applied to file-backed UNIX domain sockets after binding. It has no effect on TCP/IP or abstract namespace sockets.
func WithTrustedProxies ¶ added in v1.10.0
func WithTrustedProxies(trusted utils.TrustedProxies) Option
WithTrustedProxies sets the peers whose client IP header is trusted, as parsed by utils.ParseTrustedProxies. It only has an effect together with WithClientIPHeader.
type Server ¶
type Server struct {
CertStorage *netutil.CertStorage
// contains filtered or unexported fields
}
Server is the static website hosting endpoint.
func NewServer ¶
NewServer creates a new static website hosting server. The domain parameter is the base domain for virtual-host routing:
- Host "blog.<domain>" resolves to bucket "blog"
- Host "<domain>" (apex, no subdomain) resolves to bucket "<domain>"
func (*Server) ServeMultiPort ¶
ServeMultiPort creates listeners for multiple address specifications and serves on all of them simultaneously.