A simple server application that allows you to perform Wake-on-LAN remotely with a web interface

Overview

WoL Helper

npm version

A simple server application that allows you to perform Wake-on-LAN remotely with a web interface.

Usage

Install:

npm install -g wol-helper

Then run:

wol-helper /path/to/config.json

That will start the web (and API) server, which by default listens on TCP port 3000 but can be modified in the configuration file.

The application will create the configuration file if not exist. However, the server will run without persistent storage if started without the path parameter:

wol-helper

At which point it's still functional, but all machines will be lost once restarted.

For users who want to run it with Docker, remember to use the host network:

docker run -d \
    --name wol-helper \
    --net host \
    -v /your_path/wol-helper:/usr/local/etc/wol-helper \
    --restart unless-stopped \
    hehongbo/wol-helper

Configuration

{
  "listenPort": 3000,
  "machines": [
    {
      "name": "example",
      "macAddress": "aabbccddeeff",
      "ipAddress": "192.168.0.11/24"
    }
  ],
  "defaultSubnet": "192.168.0.0/24",
  "magicPacketUDP": 9,
  "sendUnicast": false
}
  • listenPort (integer, default to 3000): TCP port to listen to.
  • machines (array, default to []) : Information of each machine.
    • (object)
      • name (string): Name of the machine.
      • macAddress (string, required): MAC address of the machine.
        The application use 12-bit hex numbers without separator, though aa:bb:cc:dd:ee:ff (most commonly used), aa-bb-cc-dd-ee-ff (commonly seen on Windows devices), and aabb:ccdd:eeff (commonly seen on switches/routers) are accepted.
      • ipAddress (string): IP address (in CIDR) of the machine.
        Though not required, it's recommended to fill in this value since the application will use this to determine which subnet to send the magic packet to.
        Please provide IP addresses in CIDR form (like 192.168.0.11/24). Addresses without subnet length will be rejected.
  • defaultSubnet (string)
    Default subnet to which the application will broadcast magic packets if the machine's ipAddress is not defined. However, if this is also not defined, magic packets will be sent to 255.255.255.255.
  • magicPacketUDP (integer, default to 9): The UDP port to send magic packets to.
  • sendUnicast (boolean, default to false)
    Once set, the application will send magic packets to a specific IP address instead of broadcast addresses like 192.168.0.255. This is usually both unnecessary and not recommended since ARP records on the machine/switches/routers are likely to expire after the machine is turned off for a while, thus the magic packet simply cannot reach.

Note that configuration format might change before version 1.0.

API

Wake a machine

POST /api/wake/aabbccddeeff

This will send a magic packet which wakes aa:bb:cc:dd:ee:ff to:

  • It's broadcast address (If the machine was added in the configuration before, with ipAddress field properly defined).
  • The broadcast address of defaultSubnet (If the machine was not added before).
  • 255.255.255.255 (If defaultSubnet is also not defined).

Note that we only accept 12-bit hex here. Separators are not allowed.

Response:

  • 200 OK Magic packet sent successfully (This does not mean the machine is waked up successfully).
  • 400 Bad Request MAC address is not provided in the right format.

Add a new machine

POST /api/machine

Request body:

{
  "name": "example",
  "macAddress": "aabbccddeeff",
  "ipAddress": "192.168.0.11/24"
}

Response:

  • 201 Created The machine is added.
  • 400 Bad Request
    • Another Machine with this MAC address already exists.
    • Invalid information is provided in the request body.

Get a machine's information

GET /api/machine/aabbccddeeff

Response:

  • 200 OK with the machine's information returned in JSON format.
  • 400 Bad Request MAC address is not provided with the right format.
  • 404 Not Found Machine with that MAC address does not exist.

Get all machines' information

GET /api/machine

Response: 200 OK with all machines' information returned as a JSON array.

Update a machine's information

PUT /api/machine/aabbccddeeff

Request body:

{
  "name": "example",
  "macAddress": "aabbccddeeff",
  "ipAddress": "192.168.0.11/24"
}

Note that macAddress field is also required here, which you should fill in the same address if you update something else besides macAddress. Filling in a different address will result in the machine's MAC address being changed, and you will need to call the API with the new address next time you want to wake/update/delete it.

Response:

  • 200 OK with the machine's updated information returned in JSON format.
  • 400 Bad Request
    • MAC address is not provided with the right format.
    • Invalid information is provided in the request body.
  • 404 Not Found Machine with that MAC address does not exist.

Delete a machine

DELETE /api/machine/aabbccddeeff

Response:

  • 200 OK The machine is deleted.
  • 400 Bad Request MAC address is not provided in the right format.
  • 404 Not Found Machine with that MAC address does not exist.
You might also like...

A PHP Laravel web application that uses most of Laravel technologies to build that gym system

A PHP Laravel web application that uses most of Laravel technologies to build that gym system

A PHP Laravel web application that uses most of Laravel technologies to build that gym system.The System is based on rules. Admin, City Manager, Gym Manager. All Crud operations running using data tables.

Dec 29, 2022

This web application retrieves real live data from the SpaceX API

This web application retrieves real live data from the SpaceX API

This web application retrieves real live data from the SpaceX API. It provides commercial and scientific space travel services, by allowing users to book rockets and join selected space missions.

Aug 9, 2022

Free, open-source crypto trading bot, automated bitcoin / cryptocurrency trading software, algorithmic trading bots. Visually design your crypto trading bot, leveraging an integrated charting system, data-mining, backtesting, paper trading, and multi-server crypto bot deployments.

Free, open-source crypto trading bot, automated bitcoin / cryptocurrency trading software, algorithmic trading bots. Visually design your crypto trading bot, leveraging an integrated charting system, data-mining, backtesting, paper trading, and multi-server crypto bot deployments.

Free, open-source crypto trading bot, automated bitcoin / cryptocurrency trading software, algorithmic trading bots. Visually design your crypto trading bot, leveraging an integrated charting system, data-mining, backtesting, paper trading, and multi-server crypto bot deployments.

Jan 1, 2023

An improved discord bot for my discord server.

Ancalagon Bot Description Hello! This is a discord bot for my personal discord server. It's more of a remaster of my DragonBot but it's written in Jav

Jul 6, 2022

A cool Discord bot to manage tickets on your server 🎫

A cool Discord bot to manage tickets on your server 🎫

Discord Tickets Bot A cool Discord bot to manage tickets on your server 🎫 Project under construction... follow the progress on the Discord server. If

Oct 10, 2022

Bot managing the Devos Code Discord server

Bot managing the Devos Code Discord server

Dec 17, 2022

TrackIt - Single Page Application that helps the user track their habits.

TrackIt - Single Page Application that helps the user track their habits.

TrackIt - Single Page Application that helps the user track their habits. Implemented with JavaScript/React and an API server which enables the user to sign-in or sign-up in the app.

Apr 13, 2022

NodeJS application to upload an image to a S3 Bucket on AWS.

NodeJS application to upload an image to a S3 Bucket on AWS.

node-upload-image-to-s3-bucket NodeJS application to upload an image to a S3 Bucket on AWS. How it works: You must make a POST request to /upload-imag

Sep 28, 2022

💬 Real-time chat application prototype that can summarise the entire chat log

💬 Real-time chat application prototype that can summarise the entire chat log

Chat summarizer 📝 Disclaimer! This is a prototype and a fun project that I've been working on and it is not ready for production. It was done in a fe

Jan 22, 2022
Owner
Hongbo
Hongbo
API routes are great for APIs, but for small projects where you have to access server data or hide application logic, you can just call a server function from the client.

API routes are great for APIs, but for small projects where you have to access server data or hide application logic, you can just call a server function from the client.

null 3 Mar 6, 2022
A Sequelize web builder interface. To make your own sequelize schema

A Sequelize web builder interface. To make your own sequelize schema

Ulysse 5 Mar 9, 2022
A user script for the web that allows you to view and edit files in the Godot Web Editor

Godot-Web-File-Manager This is a user script for the web that allows you to view and edit files in the Godot Web Editor. You can even use this to enab

Roujel Williams 4 Jan 31, 2022
Online Golang Struct to TypeScript Interface Converter

Golang Struct to TypeScript Interface Use this tool live! https://stirlingmarketinggroup.github.io/go2ts/ This tool converts Go structs to TypeScript

Stirling Marketing Group 42 Dec 17, 2022
A prebuilt Express JS Authentication & Authorization Project based on a REST API interface.

A prebuilt Express JS Authentication & Authorization Project based on a REST API interface. It has the basic authentication and Authorization routes with the latest security measures implemented so that your application is much more secure from day 1. You are welcome to build upon and extend this project as and when required.

Soumalya Bhattacharya 2 Oct 7, 2022
Travel Lovers - an application that allows a travel enthusiast to create an account to log past, upcoming, and bucket-list trips

Travel Lovers Table of Contents Description Tools Used Installation Instructions Usage License Tests Questions Description Travel Lovers is an applica

Nicholas Nolen 5 Aug 31, 2022
NatsirtMC is a lightweight app allowing you to connect to any Minecraft server without having Minecraft open

NatsirtMC the only way to grind without grinding NatsirtMC is a lightweight app allowing you to connect to any Minecraft server without having Minecra

tristan 3 Dec 26, 2022
A code that allows you to get custom spotify rich presence

Spotifycord A code that allows you to get custom spotify rich presence! The index.js is the main file. server.js prevents your repl from going to slee

Phantom 19 Oct 7, 2022
A simple implementation of a task list application that can be used to add, remove, edit and check users tasks

"To-do list" is a tool that helps to organize daily activites. It simply lists the things which are needed to be done and allows user to mark them as complete. In this step of project, the CRUD (create, update, delete) methods are implemented. This simple web page is built using webpack and served by a webpack dev server.

Zahra Arshia 5 Mar 28, 2022
Insider Unlocked is an ongoing web application

Insider Unlocked is an ongoing web application we have been co-developing for the past few months which aggregates stock trading data of US senators and presents it in a digestible manner for the average retail investor

null 3 Feb 13, 2022