Documentation
¶
Overview ¶
Package http provides HTTP listeners/servers, for autoconfiguration/autodiscovery, the account and admin web interface and MTA-STS policies.
Index ¶
- func HandleForward(h *config.WebForward, w http.ResponseWriter, r *http.Request, path string) (handled bool)
- func HandleRedirect(h *config.WebRedirect, w http.ResponseWriter, r *http.Request) (handled bool)
- func HandleStatic(h *config.WebStatic, w http.ResponseWriter, r *http.Request) (handled bool)
- func Listen()
- func Serve()
- func WebHandle(w *loggingWriter, r *http.Request, host dns.Domain) (handled bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleForward ¶ added in v0.0.2
func HandleForward(h *config.WebForward, w http.ResponseWriter, r *http.Request, path string) (handled bool)
HandleForward handles a request by forwarding it to another webserver and passing the response on. I.e. a reverse proxy. It handles websocket connections by monitoring the websocket handshake and then just passing along the websocket frames.
func HandleRedirect ¶ added in v0.0.2
func HandleRedirect(h *config.WebRedirect, w http.ResponseWriter, r *http.Request) (handled bool)
HandleRedirect writes a response with an HTTP redirect.
func HandleStatic ¶ added in v0.0.2
HandleStatic serves static files. If a directory is requested and the URL path doesn't end with a slash, a response with a redirect to the URL path with trailing slash is written. If a directory is requested and an index.html exists, that file is returned. Otherwise, for directories with ListFiles configured, a directory listing is returned.
func Listen ¶ added in v0.0.2
func Listen()
Listen binds to sockets for HTTP listeners, including those required for ACME to generate TLS certificates. It stores the listeners so Serve can start serving them.
func WebHandle ¶ added in v0.0.2
WebHandle serves an HTTP request by going through the list of WebHandlers, check if there is a domain+path match, and running the handler if so. WebHandle runs after the built-in handlers for mta-sts, autoconfig, etc. If no handler matched, false is returned. WebHandle sets w.Name to that of the matching handler.
Types ¶
This section is empty.