Wakeonlan - Golang wake on lan service

Wake On Lan Service

This application is implemented with golang to wake up the computers.

Service Configration

By default, http server listens :8080 address. To change or bind different address, set LISTEN environment variable.

Container

docker run -it --rm --network host ghcr.io/ahmetozer/wakeonlan

Available API endpoints

You wake up the computers via web ui or if you want you can use api endpoints.

Interfaces

List the interfaces with IP addresses.

  • Method: GET
  • Endpoint: /api/interfaces
[
    {
        "Device": "lo",
        "IPAddr": [
            "127.0.0.1/8",
            "::1/128"
        ]
    }
]

ArpEntries

List the MAC addreses with details.

  • Method: GET
  • Endpoint: /api/arpentries
[
    {
        "IPAddr": "172.23.80.1",
        "HWType": "0x1",
        "Flags": "0x2",
        "HWAddr": "00:15:5d:f5:bd:67",
        "Mask": "*",
        "Device": "eth0"
    }
]

WakeOnLan

To wake up the computers.

  • Method: POST
  • Endpoint: /api/wakeonlan

Example request body

[
    {
        "mac": "00:15:5d:f5:bd:67",
        "if": "lo",
        "addr": "255.255.255.255",
        "port": "7"
    }
]

Server respond

[
    {
        "RequestNo": 1,
        "Status": "packet send"
    }
]

Usage of package

You can use wake on lan as golang function

package main

import (
    wakeonlan "github.com/ahmetozer/wakeonlan/share"
)

func main() {
    mac, _ := net.ParseMAC("00:15:5d:f5:bd:67")
    err := wakeonlan.MagicPacket{HWAddr: mac, Device: "eth0", IPAddr: "255.255.255.255", Port: "7"}.SendMagicPacket()
    fmt.Printf("%v", err)
}
Owner
Ahmet ÖZER
Engineer, the software is one of the tools. Likes to work on Network, embedded systems, cloud and IoT. Platform and Infrastructure intern
Ahmet ÖZER
Similar Resources

simple golang rest service

Simplesrv simple golang rest service Local deployment (temp) Create k3d cluster with local registry and port configuraiton k3d create --enable-registr

Oct 24, 2021

A little ping pong service that implements rate limiting with golang

Fred the Guardian Introduction Writing a little ping pong service that implements rate limiting with the programming language golang. Requirements Web

Jan 2, 2022

DNS lookup service with golang

DNS lookup service with golang

dns-lookup-service Dev Setup git clone https://github.com/philip1986/dns-lookup-service.git cd dns-lookup-service docker-compose up --build Load the

Nov 18, 2022

A http-relay server/client written in golang to forward requests to a service behind a nat router from web

http-relay This repo is WIP http-relay is a server/client application written in go(lang) to forward http(s) requests to an application behind a nat r

Dec 16, 2021

gproxy is a tiny service/library for creating lets-encrypt/acme secured gRPC and http reverse proxies

gproxy is a tiny service/library for creating lets-encrypt/acme secured gRPC and http reverse proxies

gproxy is a reverse proxy service AND library for creating flexible, expression-based, lets-encrypt/acme secured gRPC/http reverse proxies GProxy as a

Sep 11, 2022

Use Consul to do service discovery, use gRPC +kafka to do message produce and consume. Use redis to store result.

Use  Consul to do service discovery, use gRPC +kafka to do message produce and consume. Use redis to store result.

目录 gRPC/consul/kafka简介 gRPC+kafka的Demo gRPC+kafka整体示意图 限流器 基于redis计数器生成唯一ID kafka生产消费 kafka生产消费示意图 本文kafka生产消费过程 基于pprof的性能分析Demo 使用pprof统计CPU/HEAP数据的

Jul 9, 2022

Generate types and service clients from protobuf definitions annotated with http rules.

protoc-gen-typescript-http Generates Typescript types and service clients from protobuf definitions annotated with http rules. The generated types fol

Nov 22, 2022

MOSN is a cloud native proxy for edge or service mesh. https://mosn.io

MOSN is a cloud native proxy for edge or service mesh. https://mosn.io

中文 MOSN is a network proxy written in Golang. It can be used as a cloud-native network data plane, providing services with the following proxy functio

Dec 30, 2022

A simple RPC framework with protobuf service definitions

Twirp is a framework for service-to-service communication emphasizing simplicity and minimalism. It generates routing and serialization from API defin

Jan 7, 2023
Comments
  • cannot call pointer method on share.MagicPacket literal

    cannot call pointer method on share.MagicPacket literal

    Usage example doesn't compile.

    cannot call pointer method on share.MagicPacket literal

    package main
    
    import (
    	"fmt"
    	wakeonlan "github.com/ahmetozer/wakeonlan/share"
    	"net"
    )
    
    func main() {
    	mac, _ := net.ParseMAC("00:15:5d:f5:bd:67")
    	err := wakeonlan.MagicPacket{HWAddr: mac, Device: "eth0", IPAddr: "255.255.255.255", Port: "7"}.SendMagicPacket()
    	fmt.Printf("%v", err)
    }
    
    
A little web on the LAN
A little web on the LAN

lannet Lannet creates a little web on the LAN. It runs a fileserver daemon in the background, and hosts a homepage that links to other lannet servers

Jan 16, 2022
Connect to SagerNet in the LAN

SagerConnect Connect to SagerNet in the LAN (no configuration required) Usage Upgrade SagerNet to 0.4-rc02 or later Enable "Allow Connections from LAN

Jan 6, 2023
Quickly find all IPv6 and IPv4 hosts in a LAN.

invaentory Quickly find all IPv6 and IPv4 hosts in a LAN. Overview ?? This project is a work-in-progress! Instructions will be added as soon as it is

May 17, 2022
iflandown runs commands after the wired LAN link is down for a given amount of time.

iflandown iflandown runs commands after the wired LAN link is down for a given amount of time. All/most linux devices should work. Tested on amd64, Ra

Mar 16, 2022
Service that calls uzma24/project1 service, takes input from .txt file and prints JSON output returned from the service.

Service that calls uzma24/project1 service, takes input from .txt file and prints JSON output returned from the service. Program can take large input files.

Feb 6, 2022
A service registry and service discovery implemention for kitex based on etcd

kitex etcd Introduction kitexetcd is an implemention of service registry and service discovery for kitex based on etcd. Installation go get -u github.

Feb 18, 2022
A service to proxy requests to a given backend service.

Proxy Service A service to proxy requests to a given backend service. Go 1.17+ Clone git clone [email protected]:janu-cambrelen/proxy-service.git Run (L

Jan 5, 2022
An URL shortener service written in Golang

ggz An URL shortener service written in Golang. Features Support MySQL, Postgres or SQLite Database. Support RESTful or GraphQL API. Support Auth0 or

Dec 26, 2022
Golang Client for querying Tor network data using the Onionoo service.

gonion Lightweight Golang wrapper for querying Tor network data using the Onionoo service. package main import ( "github.com/R4yGM/gonion"

May 11, 2022