/wagow

:pager: Wake-on-lan/wan service

Primary LanguageGoMIT LicenseMIT

☎️ wagow

GoDoc Go Report Card License

A simple HTTP service that sends Wake-on-Wan magic packets.

Installation

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

Building

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

Usage

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:port
  • target: MAC-48 hardware address of the machine
  • password: the SecureOn password (optional)

If the destination address does not include a port, a default one (9) will be added automatically.

License

Copyright (c) 2017, William Poussier (MIT Licence)