An open API service indexing awesome lists of open source software.

https://github.com/idebeijer/wol-http-server


https://github.com/idebeijer/wol-http-server

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# wol-http-server

## About wol-http-server

Wol-http-server is a simple service written in Rust that allows you to wake up devices on your local network (LAN) using the Wake-on-LAN (WOL) protocol. With wol-http-server, you can send a WOL packet to a device by making a simple HTTP POST request to the server.

## Usage

When the service runs somewhere and the device you want to target has WOL enabled you'll need to make a `POST` request to `http://:/wake?mac=`

Where:

- `` should contain the (local) IP or hostname where the service is running on e.g. 192.168.0.0
- `` should contain the same port you also passed the program as argument
- `` should contain the MAC address of the device you are targeting e.g. `00:00:00:00:00:00`

Curl example: `curl -X POST "http://192.168.0.0:0000/wake?mac=00:00:00:00:00:00"`

If you want to test if you can reach the service, it also provides a ping GET endpoint: `http://:/ping`

Curl example: `curl -X GET "http://192.168.0.00:0000/ping"`

## Building the program

### Prerequisites

- Rust compiler and tools (installation instructions can be found at https://www.rust-lang.org/tools/install)

### Build

1. Clone this repo
2. Open a terminal in the project
3. Run `cargo build --release` (Optionally compile program for a different target: https://rust-lang.github.io/rustup/cross-compilation.html)
4. After building you'll find the executable at `target/release/wol-http-server`

## Running the program

### \*nix operating systems

1. Run `./wol-http-server ` where `` will be replaced by the port you want to run the service on