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 ¶
Types ¶
type Middleware ¶
type Middleware struct { MAC string `json:"mac,omitempty"` // 目标主机的 MAC 地址,格式应与 net.ParseMAC 兼容。 BroadcastAddress string `json:"broadcast_address,omitempty"` // 魔术包应发送到的广播地址(<ip>:<port>)。默认为 "255.255.255.255:9"。 // contains filtered or unexported fields }
结构体使用 wake-on-lan 技术,可以在 HTTP 请求时唤醒目标主机。
func (*Middleware) Provision ¶
func (m *Middleware) Provision(ctx caddy.Context) error
Prepare 函数用于准备唤醒信号和用于发送信号的 socket。 函数实现 caddy.Provisioner 接口
func (Middleware) ServeHTTP ¶
func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
函数用于发送准备好的唤醒信号,并透明地继续下一个 HTTP 处理程序。
func (*Middleware) UnmarshalCaddyfile ¶
func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
函数用于解析 Caddyfile 配置文件中的参数。
Click to show internal directories.
Click to hide internal directories.