Documentation ¶
Index ¶
- func BuildMagicPacket(mac net.HardwareAddr) []byte
- type Middleware
- func (Middleware) CaddyModule() caddy.ModuleInfo
- func (m *Middleware) Cleanup() error
- func (m *Middleware) Provision(ctx caddy.Context) error
- func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildMagicPacket ¶
func BuildMagicPacket(mac net.HardwareAddr) []byte
Types ¶
type Middleware ¶
type Middleware struct { // MAC address of the target host in a net.ParseMAC compatible format. MAC string `json:"mac,omitempty"` // Broadcast address (<ip>:<port>) the magic packet should be sent to. // Defaults to "255.255.255.255:9". BroadcastAddress string `json:"broadcast_address,omitempty"` // contains filtered or unexported fields }
Middleware wakes up a target host on HTTP requests using wake-on-lan.
func (Middleware) CaddyModule ¶
func (Middleware) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*Middleware) Cleanup ¶
func (m *Middleware) Cleanup() error
Cleanup closes the prepared broadcast socket.
func (*Middleware) Provision ¶
func (m *Middleware) Provision(ctx caddy.Context) error
Prepare the magic packet and the socket used to send it Provision implements caddy.Provisioner.
func (Middleware) ServeHTTP ¶
func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
ServeHTTP dispatches the prepared magic packet and transparently continues with the next http handler.
func (*Middleware) UnmarshalCaddyfile ¶
func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
Click to show internal directories.
Click to hide internal directories.