A simple HTTP service that sends Wake-on-Wan magic packets.
First, get the source code using go get
or using git clone
and ensure all dependencies are installed.
# Clone
$ git clone https://github.com/wI2L/wagow.git
# Install dependencies.
$ go get -u github.com/golang/dep/...
$ dep ensure
To build a docker image and launch it, you can use those commands that will produce a lightweight image and run it in background.
$ CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' cmd/wagow/wagow.go
$ docker build -t wI2L/wagow .
$ docker run -d --publish 8080:8080 --name wagow wi2l/wagow
The service expose a single route at POST /
that sends a wake-on-wan magic packet to the destination machine upon receiving a request.
The parameters can be sent using either application/json
or application/x-form-www-urlencoded
content types.
address
: IP address or FQDN of the machine in the format host:porttarget
: MAC-48 hardware address of the machinepassword
: the SecureOn password (optional)
If the destination address does not include a port, a default one (9) will be added automatically.
Copyright (c) 2017, William Poussier (MIT Licence)