website

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

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

func WithClientIPHeader(header string) Option

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 WithQuiet

func WithQuiet() Option

WithQuiet silences default logging output.

func WithSocketPerm

func WithSocketPerm(perm os.FileMode) Option

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 WithTLS

func WithTLS(cs *netutil.CertStorage) Option

WithTLS sets TLS credentials.

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

func NewServer(be backend.Backend, domain string, opts ...Option) *Server

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

func (s *Server) ServeMultiPort(ports []string) error

ServeMultiPort creates listeners for multiple address specifications and serves on all of them simultaneously.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the server.

Jump to

Keyboard shortcuts

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