Documentation
¶
Index ¶
Constants ¶
View Source
const ErrorSetterCtxKey = "handler_error_setter_ws"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorSetterFunc ¶
type ProxyHandler ¶
type ProxyHandler struct {
// Header fields to set on the response; overwrites any existing
// header fields of the same names after normalization.
Headers http.Header `json:"headers,omitempty"`
// Upstream addresses to establish connections. Supports TCP and Unix
// domain sockets. Must contain at least one element.
// Examples: "127.0.0.1:1080", "unix:/run/server.sock"
Upstream []string `json:"upstream,omitempty"`
// contains filtered or unexported fields
}
ProxyHandler implements a simple responder for Websocket requests which bidirectionally copies the stream between both parties.
func (*ProxyHandler) CaddyModule ¶
func (*ProxyHandler) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*ProxyHandler) Provision ¶
func (s *ProxyHandler) Provision(ctx caddy.Context) error
Provision sets up ProxyHandler.
func (*ProxyHandler) ServeHTTP ¶
func (s *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
func (*ProxyHandler) UnmarshalCaddyfile ¶
func (s *ProxyHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile sets up the handler from Caddyfile tokens. Syntax:
websockify [<matcher>] <upstream> [<upstream>]
Click to show internal directories.
Click to hide internal directories.