Skip to content

A LAN device discovery app. Basically a NestJS wrapper around arp with simple REST apis and event emitters.

Notifications You must be signed in to change notification settings

Phoenix-Chen/LANDD

Repository files navigation

LANDD


Description

A LAN device discovery app. Basically a NestJS wrapper around arp with simple REST apis and event emitters.

Requirements

  • arp
  • nmap (Likely to remove dependency on nmap in future)

REST Endpoints

GET /device

Get devices.

Parameter

  • ?online=: boolean
  • ?macAddress_in=: String array separated by ,. e.g. 61:d7:3d:c4:4d:95,db:73:5f:13:14:05

Example Response

  • Status: 200
  • Content-Type: "application/json"
[
    {
        "macAddress": "61:d7:3d:c4:4d:95",
        "name": null,
        "ip": "192.168.1.2",
        "online": true,
    },
    {
        "macAddress": "db:73:5f:13:14:05",
        "name": null,
        "ip": "192.168.1.3",
        "online": false,
    },
]

PATCH /device/:macAddress

Patch the name of device.

Payload

  • Content-Type: "application/json"
{
    "name": "My new iPhone",
}

Example Response

  • Status: 200
  • Content-Type: "application/json"
{
    "macAddress": "61:d7:3d:c4:4d:95",
    "name": "My new iPhone",
    "ip": "192.168.1.2",
    "online": true,
}

Events

This app provides 2 types of event:

  • Device Connect: Triggers when device connects to the network.
  • Device Disconnect: Triggers when device disconnects from the network.

You can overwrite the listener functions with custom event handler logic here. The event payload represents single device in the format of:

{
    "macAddress": "61:d7:3d:c4:4d:95",
    "name": "My new iPhone",
    "ip": "192.168.1.2",
    "online": true,
}

About

A LAN device discovery app. Basically a NestJS wrapper around arp with simple REST apis and event emitters.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published