Documentation
¶
Index ¶
- func FlushingIoCopy(dst io.Writer, src io.Reader, buf []byte) (written int64, err error)
- func RemoveHopByHop(header http.Header)
- func StripPort(address string) string
- func WriteSiteNotFound(w http.ResponseWriter, r *http.Request)
- func WriteTextResponse(w http.ResponseWriter, status int, body string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlushingIoCopy ¶
FlushingIoCopy is analogous to buffering io.Copy(), but also attempts to flush on each iteration. If dst does not implement http.Flusher(e.g. net.TCPConn), it will do a simple io.CopyBuffer(). Reasoning: http2ResponseWriter will not flush on its own, so we have to do it manually.
func RemoveHopByHop ¶
func WriteSiteNotFound ¶
func WriteSiteNotFound(w http.ResponseWriter, r *http.Request)
WriteSiteNotFound writes appropriate error code to w, signaling that requested host is not served by Caddy on a given port.
func WriteTextResponse ¶
func WriteTextResponse(w http.ResponseWriter, status int, body string)
WriteTextResponse writes body with code status to w. The body will be interpreted as plain text.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.